"Unable to authenticate your credentials" error when you try to connect to Azure Active Directory

Applies to: Azure Active DirectoryCloud Services (Web roles/Worker roles)Microsoft Intune

PROBLEM


When you try to connect to Microsoft Azure Active Directory (Azure AD) by using the Azure Active Directory Module for Windows PowerShell, you receive the following error message:
Connect-MsolService : Unable to authenticate your credentials. Make sure that
your user name is in the format: <username>@<domain>. If this issue persists,
contact Support.

At line:1 char:1
+ Connect-MsolService
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Connect-MsolService], Mic
rosoftOnlineException
+ FullyQualifiedErrorId : 0x80048862,Microsoft.Online.Administration.Autom
ation.ConnectMsolService

CAUSE


This occurs if one of the following conditions is true: 
  • You used an incorrect format when you entered your user name.
  • Your user account is enabled for Azure Multi-Factor Authentication.

SOLUTION


Do one of the following, as appropriate for your situation.

Scenario 1: You used an incorrect format when you entered your user name

Use the following format when you enter your user name:
<user_name>@<domain>
For example, john@contoso.com is in the correct format. Entering john or contoso\john doesn't work. 

Scenario 2: Your user account is enabled for Azure Multi-Factor Authentication

If your user account is enabled for Azure Multi-Factor Authentication, Microsoft does not currently support using the Azure Active Directory Module for Windows PowerShell to connect to Azure AD. 

To perform administrative tasks by using the Azure Active Directory Module for Windows PowerShell, either disable Azure Multi-Factor Authentication for the user account or use a different admin account that isn't enabled for Azure Multi-Factor Authentication.

MORE INFORMATION


Still need help? Go to Microsoft Community or the Azure Active Directory Forums website.