If, for whatever reason (in my case, my test environment), you need to eliminate the synchronization between your Active Directory and Azure Active Directory, today I am giving you the steps on how to do it.
Turn off sync first
Before uninstalling Azure AD Connect, the first thing you need to do is disable sync. To do this you must launch the following commands through PowerShell:
#Install MSOnline PowerShell Module Install-Module -Name MSonline #Use your AAD Global Admin account and get the credentials $msolcred = Get-Credential #Connect to AAD Connect-MsolService -Credential $msolcred #Retrieve Synchronization status (Get-MSOLCompanyInformation).DirectorySynchronizationEnabled #Disable Synchronization Set-MsolDirSyncEnabled –EnableDirSync $false #Retrieve Synchronization status again (Get-MSOLCompanyInformation).DirectorySynchronizationEnabled
This process is not immediate and can take up to 72 hours to complete, depending on the size of your directory.
Uninstall Azure AD Connect
Once you have disabled synchronization you can remove Azure AD from the domain.