Hi There
Even if you’re doing LABs, PoC (Proff of conceps) or rolling Azure AD connect (AD sync) on production sometimes you might face the follow error message:
To fix this do the following:
Connect to your Office 365 Tenant using PowerShell
$msolcred = get-credential
connect-msolservice -credential $msolcred
Disable directory synchronization. To do this, type the following cmdlet, and then press Enter:
Set-MsolDirSyncEnabled –EnableDirSync $false
Check that directory synchronization was fully disabled by using the Windows PowerShell. To do this, run the following cmdlet periodically:
(Get-MSOLCompanyInformation).DirectorySynchronizationEnabled
This command will return True or False. Continue to run this periodically until it returns False, and then go to the next step.
Note 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.
Remove-MsolUser -UserPrincipalName Sync_SRV-DC01_8f0a01761ef9@tecbis.onmicrosoft.com
Refresh, and the user will have moved to “deleted users.” You can delete it from there, or leave it alone and left Azure kill it off in 30 days.
Re-enable Directory Synchronization
To re-enable directory synchronization, run the following cmdlet:
Set-MsolDirSyncEnabled -EnableDirSync $true
Reference
https://docs.microsoft.com/en-us/previous-versions/azure/jj151815(v=azure.100)?redirectedfrom=MSDN
thanks,