Azure-Samples / azure-files-samples

This repository contains supporting code (PowerShell modules/scripts, ARM templates, etc.) for deploying, configuring, and using Azure Files.
https://docs.microsoft.com/azure/storage/files/storage-files-introduction
MIT License
226 stars 192 forks source link

AzFilesHybrid - Add parametrized AD Credential for use with admin account or service account #222

Open jhauray opened 3 months ago

jhauray commented 3 months ago

In our business use cas, we have a seperated account for admin tasks. This admin account is highly securized : Strong password, MFA, and it can't open a session.

I am not able to use the module as released. So I forked it to add a "credential" parameter in cmdlet. Example :

Join-AzStorageAccount `
         -ResourceGroupName $ResourceGroupName `
         -StorageAccountName $StorageAccountName `
         -DomainAccountType $DomainAccountType `
         -OrganizationalUnitDistinguishedName $OuDistinguishedName `
         -Credential $credential

And I overloaded all ActiveDirectory module cmdlet call in AzFilesHybrid, with credential. In this way, I was able to use the module with my admin account.

Can you add this feature by design in your original module ?