Generally speaking, depends on the module. For some modules, when you pass the -Credentials parameter, it uses Basic authentication. For others, it can still perform modern auth, but it will fail if you have MFA in place, as you cannot complete this flow. Anyway, for the Azure AD module, either method results in using Modern auth (assuming recent version).
"Modern authentication" and Azure powershell cmdlets
Janis Zimelis
21
Reputation points
Hello
I have question regarding "Modern authentication" and Azure powershell cmdlets.
If I will use Connect-azuread cmdlet with account, that don't have multi factor authentication enabled, it will work as ""Modern authentication" or it works as "Basic Authentication"?
Here is script example:
$username = "******@mydomain.com"
$password = ConvertTo-SecureString "StrongPassword" -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
Connect-azuread -Credential $cred
Windows for business | Windows Server | User experience | PowerShell
8,330 questions
Microsoft Security | Microsoft Entra | Microsoft Entra ID
25,081 questions
Accepted answer
-
Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
2021-01-14T08:47:50.737+00:00