Can not stop AD connect sync after disconnect from On-prem DC

Ashkan Aminzadeh 31 Reputation points

its been 5 days since we removed AD connect from our on-prem DC, but its still does not allow me to delete the sync :

Set-MsolDirSyncEnabled -EnableDirSync $false

Continue with this operation?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
Set-MsolDirSyncEnabled : You cannot turn off Active Directory synchronization.
At line:1 char:1

  • Set-MsolDirSyncEnabled -EnableDirSync $false
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : OperationStopped: (:) [Set-MsolDirSyncEnabled], MicrosoftOnlineException
  • FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.DirSyncStatusChangeNotAllowedException,Micros

Has anyone faced this issue?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,667 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Vasil Michev 90,881 Reputation points MVP

    DirSyncStatusChangeNotAllowedException usually means that it's in the process of disabling it, which can take up to 72 hours. If more than that has passed since you run the cmdlet, open a support case.

    1 person found this answer helpful.
    0 comments No comments

  2. Siva-kumar-selvaraj 15,566 Reputation points

    Hello @Ashkan Aminzadeh ,

    Could you please confirm what does the status of this cmdlet? Get-MSOLCompanyInformation | select DirectorySynchronizationStatus

    Additionally, as @Vasil Michev mentioned once you have disabled dirsync through this cmdlet it may take 72 hours for deactivation to be completed. The time depends on the number of objects that are in your cloud service subscription account. If you still experiencing same behavior even after waiting 72 hours then you may reach out to MS support on this issue.

    Hope this was helpful.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.