Azure AD Connect - Manually match On Premise AD-user to existing Office365 user

1
ldifde -d “DistinguishedName of the user : example : CN=user,OU=test,OU=Users,test=DC=test,DC=local” -f “c:\temp\exporteduser.txt”
[LDIFDE Export] [LDIFDE Export]
1
set-msoluser -userprincipalname [email protected] -ImmutableID tutCmzWErE+zYRZlFzK/1A==

Note: If doesn’t work from the first time. probably the ImmutableID is already set to a user. When you trying to set the ImmutableID, you will receive an error.

1
Get-MsolUser -All | Where-Object {$_.ImmutableID -eq “tutCmzWErE+zYRZlFzK/1A==”}

Same result, but for the deleted users. Hard delete the user in Office 365 and you can set the ImmutableID for the correct user :

1
Get-MsolUser -All -ReturnDeletedUsers | Where-Object {$_.ImmutableID -eq “tutCmzWErE+zYRZlFzK/1A==”}
1
Remove-MsolUser -UserPrincipalName [email protected] -RemoveFromRecycleBin