Fix pending state issue with Directory synchronization for Microsoft 365, Azure, or Intune

Symptoms

You experience one of the following symptoms in a Microsoft cloud service such as Microsoft 365, Microsoft Azure, or Microsoft Intune:

  • When you activate directory synchronization in the Microsoft 365 admin center, the page indicates that directory synchronization is enabled. However, when you install the Azure Active Directory Sync tool and run the Configuration Wizard, you receive the following message:

    Error 15: DirSync not activated

    You then revisit the Directory sync status page to view the directory synchronization status. When you look under 3: Active Directory Synchronization in the center pane, you see the following message:

    Active Directory synchronization is being activated

  • When you deactivate directory synchronization on the Directory sync status page of the Microsoft 365 portal, the page indicates that directory synchronization is enabled.

    You then revisit the Directory sync status page to view the directory synchronization status. When you look under 3: Active Directory Synchronization in the center pane, you see the following message:

    Active Directory synchronization is being deactivated

Cause

This issue may occur if directory synchronization isn't completely activated or deactivated. It may take up to 72 hours for activation or deactivation to finish.

Note

Azure AD Powershell is planned for deprecation on March 30, 2024. To learn more, read the deprecation update.

We recommend migrating to Microsoft Graph PowerShell to interact with Microsoft Entra ID (formerly Azure AD). Microsoft Graph PowerShell allows access to all Microsoft Graph APIs and is available on PowerShell 7. For answers to common migration queries, see the Migration FAQ.

To determine whether directory synchronization is activated or deactivated, follow these steps by using the Azure Active Directory module for Windows PowerShell:

  1. Select Start, type Azure Active Directory module for Windows PowerShell in the search box, and then select Azure Active Directory module for Windows PowerShell.

  2. Type the following cmdlets in the order in which they are presented. Make sure that you press Enter after you type each cmdlet.

    • $cred = get-credential

      Note

      When you're prompted, enter your cloud service admin credentials.

    • Connect-MSOLService -credential $cred

    • (Get-MSOLCompanyInformation).DirectorySynchronizationEnabled

      Note

      This cmdlet returns a value of True or False. If it returns True, directory synchronization is activated. If it is False, directory synchronization is deactivated.

Resolution

Wait until directory synchronization is activated or deactivated. Note the following:

If directory synchronization isn't activated or deactivated after the expected time, follow these steps, and then contact Microsoft Support:

  1. In the same Windows PowerShell console that you used in step 2 of the "Cause" section, type the following cmdlet, and then press Enter:

    (Get-MSOLCompanyInformation).DirectorySynchronizationStatus

    Note

    If the output indicates "PendingEnabled" or "PendingDisabled" after the 24-hour or 72-hour waiting period ends, this is a known issue that affects Exchange Online.

  2. Collect the following information from the Windows PowerShell connection:

    • Context ID: To collect the context ID, type the following cmdlet, and then press Enter:

      (Get-MSOLCompanyInformation).objectID

    • Service instance: To collect the service instance, type the following cmdlet, and then press Enter:

      (Get-MSOLCompanyInformation).AuthorizedServiceInstances

  3. Contact Microsoft Support.

More information

For more information about how to enable directory synchronization in Microsoft 365, Azure, and Intune, see Prepare for directory synchronization to Microsoft 365.

Still need help? Go to Microsoft Community or the Microsoft Entra Forums website.