"Modern authentication" and Azure powershell cmdlets

Janis Zimelis 21 Reputation points
2021-01-14T07:17:41.657+00:00

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
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2021-01-14T08:47:50.737+00:00

    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).

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.