How to delete user on local dc, but save the user on azure dc?

Copper Contributor

hello all,

 

I have sync user that created on local dc and the account syn to azure.

Now I want to remove from local And save him on azure.

 

How to do that?

 

thank you everybody!!

1 Reply

To my knowledge, this is not supported as of now, however, it does the trick.

 

So the only workaround i know of, is the following:

1) In the on-prem AD, move the user to a OU that is not synced or delete the user.

2) Let "Azure AD Connect" sync

3) In AzureAD, go to deleted users, and find the user there, restore the user.

4) By using powershell, connect to the Azure AD using msolservice, find the attribute on the specific user called "ImmutableId", and delete the value.  The following code should do it for you

Set-MsolUser -UserPrincipalName usernamesomething@contoso.com -ImmutableId "$null"

 

please note, the "$null" needs to be inside "", otherwise the value will not be emptied.

 

The user should now be restored as cloud only user.

 

Like i said, i'm fairly sure this is not supported by Microsoft, so please use the above at your own risk. 

 

This is basically the opposite of doing a hard match for AD connect, when doing that, you would create the immutableID for the user.