Can't disable EntraID Connect Sync (Pending state)

Dzenan Celhasic 0 Reputation points
2026-02-27T11:54:56.8366667+00:00

$tenantID = (Get-EntraContext).TenantId
Set-EntraDirSyncEnabled -EnableDirsync $false -TenantId $tenantID -Force

Error: Requested change of DirSync status is not allowed. Cannot Disable DirSync while enable is pending

Microsoft Security | Microsoft Entra | Microsoft Entra ID

1 answer

Sort by: Most helpful
  1. AI answer

    2026-02-27T11:55:07.0466667+00:00

    The error indicates that a previous operation to enable directory synchronization (DirSync) is still in a pending state, so a disable request is blocked until that operation completes.

    Behavior from the cmdlet documentation:

    • Set-EntraDirSyncEnabled turns directory synchronization on or off for the tenant.
    • Deactivating DirSync may take up to 72 hours, depending on the number of objects in the subscription.
    • Once a DirSync state change is in progress, it cannot be canceled and must complete before any further action (including re-enabling or disabling DirSync) can be taken.

    In this situation:

    1. Wait for the current DirSync state change (the pending enable) to fully complete. This can take significant time depending on tenant size.
    2. After the enable operation has finished and the tenant is in a stable state, run the disable command again:
         Connect-Entra -Scopes 'OnPremDirectorySynchronization.ReadWrite.All', 'Organization.ReadWrite.All'
         $tenantID = (Get-EntraContext).TenantId
         Set-EntraDirSyncEnabled -EnableDirsync $false -TenantId $tenantID -Force
      

    If BlockCloudObjectTakeoverThroughHardMatch is enabled and DirSync is later re-enabled, on-premises to cloud object takeover/updates for Microsoft Entra ID–mastered objects will be blocked until that setting is set to false.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.