Environment:
- Local Active directory with Azure Ad Connect
- An Azure AD
In this lab\env I don't have Exchange in Hybrid mode.
The first step is create an OU and not sync, in my case the OU is UnsyncUser
- Move the user to UnsyncUser
- Sync the Ad Connect:
> Start-ADSyncSyncCycle -PolicyType Delta
Connect to Azure:
>Connect-MsolService
Get deleted users:
>Get-MsolUser -ReturnDeletedUsers
Restore a User:
>Restore-MsolUser -UserPrincipalName bill@maykonrds.site
If you take a look now the users is a Cloud
Another way to do that is disable the Sync:
>Set-MsolDirSyncEnabled -EnableDirSync $false
It may take 72 hours for deactivation to be completed.
Check the status, need to be false.
>(Get-MSOLCompanyInformation).DirectorySynchronizationEnabled
If you do that all users\groups will be in the Cloud.