If you work for Service provider like me, you may see many requests from customer. Our job is not only establish hybrid connection and move the mailboxes from Exchange to Office 365, I have also had a project from Office 365 to Exchange, from Office 365 to Office 365, from Lotus Notes to Office 365.
In same cases you use PowerShell rather than Office 365 Portal.
Today I will explain how to enable/disable/verify that Directory Synchronization.
First of all, of course, you need to log in to Office 365 via PowerShell
second is to see whether AAD Connect is running or not. run the below command
PS C:\WINDOWS\system32> (Get-MsolCompanyInformation).DirectorySynchronizationEnabled
as you can see, in my case, it is running
If I want to stop it, I run below command
PS C:\WINDOWS\system32> Set-MsolDirSyncEnabled -EnableDirSync $false
and If I want to run it back again
PS C:\WINDOWS\system32> Set-MsolDirSyncEnabled -EnableDirSync $True