How to Disable AD Connect Sync
To disable AD Connect sync, you need to use this command from an elevated PowerShell ISE or command line:
Set-MsolDirSyncEnabled to $false.
It is very important that you run this command prior to uninstalling AD Connect. Azure Active Directory needs AD Connect running in order to set your AD objects to cloud-only.
Also note that once completed, if for some reason you want to turn AD Connect back on, there is a 72 hour waiting period before the services will allow you to connect and sync using AD Connect again.
There are a few steps you’ll need to take in order to execute the PowerShell command successfully.
First, you need PowerShell to have the Msol cmdlets installed. They do not run on PowerShell version 7 or higher, so you will need to be on an older version of PowerShell than version 7. You can easily tell if they are installed by searching your commands, or else by just typing “Get-Msol” and seeing if the MSOL commands are there. There is a good chance they are there if you sign on to the domain controller running AD Connect.
If they are not there, you will need to install them. Make sure you run PowerShell as an admin, then type this command:
Answer “Y” to any prompts you get.
Now you can start the process. Run the commands in this order. When connecting to the service, make sure the account you connect with has permissions to administer Active Directory.
Set-MsolDirSyncEnabled -EnableDirSync $false
That’s it! It wasn’t too hard, eh? In order to verify your command worked correctly, run this command and ensure “DirectorySynchronizationEnabled” shows as “False.” It may take some time while it sets your AD objects from hybrid to cloud-only, so keep checking periodically if it doesn’t show as “False” right away.
Here’s a screenshot showing the process being run, along with the results.