When you try to use the connect-MSOLService cmdlet in the Microsoft Azure Active Directory Module for Windows PowerShell to connect to a Microsoft cloud service such as Office 365, Azure, or Microsoft Intune, your attempt is unsuccessful. You may also receive the following error message:
Connect-MsolService: Exception of type 'Microsoft.Online.Administration.Automation.MicrosoftOnlineException' was thrown.
This issue may occur for one or more of the following reasons:
- The Azure Active Directory Module for Windows PowerShell rich client can't connect to the service. This is frequently the result of client computer readiness issues.
- The user ID that's used to authenticate is single sign-on (SSO)-enabled, and a client computer problem is preventing SSO communication with Active Directory Federation Services (AD FS), with the Azure Active Directory authentication system, or with both.
To resolve this issue, follow these steps:
- Troubleshoot Office 365 rich client connectivity. For more information, see the following Microsoft Knowledge Base article: 2637629 How to troubleshoot non-browser apps that can’t sign in to Office 365, Azure, or Intune
- Troubleshoot common client configuration issues that limit SSO authentication. For more information, see the following Microsoft Knowledge Base article: 2530713 Signing in to Office 365, Azure, or Intune by using single sign-on doesn't work from some devices