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]
1 set-msoluser -userprincipalname [email protected] -ImmutableID tutCmzWErE+zYRZlFzK/1 A==
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/1 A==”}
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/1 A==”}