microsoft / PowerApps-Samples

Sample code for Power Apps, including Dataverse, model-driven apps, canvas apps, Power Apps component framework, portals, and AI Builder.
https://docs.microsoft.com/powerapps
MIT License
1.48k stars 1.67k forks source link

`Microsoft.PowerPlatform.Administration.UserManagement` - how to use Multi-Factor authentication? #538

Open bubbletroubles opened 6 months ago

bubbletroubles commented 6 months ago

How to use multi-factor authentication using the Microsoft.PowerPlatform.Administration.UserManagement powershell scripts? Many organizations mandate the use of Multi-Factor auth, especially for priviliged roles (such as what this script requires)

The documentation for the Connect-AzureAD module states that MFA can't be used with the Connect-AzureAD method been used in the script


PS C:\> Connect-AzureAD -Credential $Credential
The first command gets the user credentials, and then stores them in the $Credential variable.

The second command connects the current PowerShell session using the credentials in $Credential.

This account authenticates with Azure Active Directory using organizational ID credentials. You cannot use multi-factor authentication or Microsoft account credentials to run Azure Active Directory cmdlets with this account.```
phecke commented 5 months ago

@bubbletroubles I have forwarded your question to the people that maintain that code.