Problem: You wan't to disable or enable DirSync a couple of minutes after disabling or enabling it and you encounter:
PS C:\Users\bas.INTERN.000> 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
Solution: Wait anywhere from a few hours up to 72+ hours () as the previous change hasn't taken hold yet.
Sources: