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.
Can not stop AD connect sync after disconnect from On-prem DC
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
Confirm
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
oft.Online.Administration.Automation.SetDirSyncEnabled
Has anyone faced this issue?
2 answers
Sort by: Most helpful
-
-
Siva-kumar-selvaraj 15,686 Reputation points
2021-11-29T21:42:17.163+00:00 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.