"Connect-AzureAD" MFA support in module AzureADPreview ?

Jimmy Ståhl 26 Reputation points
2021-02-28T11:55:39.377+00:00

Hello

I want to manage my Azure AD PIM roles using AZ PowerShell or AZ CLI.

Is there a way?, I require MFA login att all levels

Error using "Connect-AzureAD":

  • Connect-AzureAD -Credential $AzureAdCred
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : AuthenticationError: (:) [Connect-AzureAD], AadAuthenticationFailedException
  • FullyQualifiedErrorId : Connect-AzureAD,Microsoft.Open.Azure.AD.CommonLibrary.ConnectAzureAD

Due to a configuration change made by your administrator,
or because you moved to a new location, you must use multi-factor authentication to access

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Entra | Other
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
    2021-02-28T13:32:38.06+00:00

    When you use the -Credential switch, you are effectively using basic auth. Run the cmdlet without any parameters.

    3 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Jimmy Ståhl 26 Reputation points
    2021-02-28T14:25:42.55+00:00

    Thank you that was the thing I missed!!

    0 comments No comments

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.