"Sorry, but we're having trouble signing you in" error when signing in to Microsoft 365

Symptoms

When you try to sign in to the Microsoft 365 portal, you receive the following error message:

Sorry, but we're having trouble signing you in.

Additionally, you might also see the following error message:

AADSTS7000112: Application '00000002-0000-0ff1-ce00-000000000000'(Office 365 Exchange Online) is disabled.

Cause

This issue occurs if the Service Principal for the Exchange Online application is disabled for the tenant.

Resolution

Before you follow these steps, make sure that the following prerequisites are met:

  • Install the Azure Active Directory module for Windows PowerShell. For more information, go to Connect to Microsoft 365 PowerShell.
  • The steps are performed by a Microsoft 365 global administrator.

To resolve this issue, follow these steps:

  1. Check the current status of the Service Principal for the Exchange Online application. To do this, run the following cmdlet:

    (Get-MsolServicePrincipal -AppPrincipalId 00000002-0000-0ff1-ce00-000000000000).accountenabled
    
  2. Enable the Service Principal for Exchange Online by running the following cmdlet:

    Get-MsolServicePrincipal -AppPrincipalId 00000002-0000-0ff1-ce00-000000000000 | Set-MsolServicePrincipal -AccountEnabled $true
    

Note

Azure AD and MSOnline PowerShell modules are deprecated as of March 30, 2024. To learn more, read the deprecation update. After this date, support for these modules are limited to migration assistance to Microsoft Graph PowerShell SDK and security fixes. The deprecated modules will continue to function through March, 30 2025.

We recommend migrating to Microsoft Graph PowerShell to interact with Microsoft Entra ID (formerly Azure AD). For common migration questions, refer to the Migration FAQ. Note: Versions 1.0.x of MSOnline may experience disruption after June 30, 2024.