Forum Discussion
Changing UPN AD User Domain
- Jan 30, 2018
DirSync sometimes fails to pick up the UPN changes. You can however change it directly in O365 via the Set-MsolUserPrincipalName cmdlet.
Yes you have to change the domain for the user manually
https://www.adamfowlerit.com/2016/05/wrong-domain-users-azure-active-directory/
Set-MSolUserPrincipalName -userprincipalname “existinguser@mydomain.local” -NewUserPrincipalName “existinguser@mydomain.com”
- blue-manJan 31, 2018Iron Contributor
I have tried the following and it still will not work! The account I am logging in with has global admin rights.
Connect-MSOLService
Set-MSolUserPrincipalName -userprincipalname firstname.lastname@domain.com -NewUserPrincipalName firstname.lastname@domain123.com
Set-MSolUserPrincipalName : Unable to complete this action. Try again later.
At line:1 char:1
+ Set-MSolUserPrincipalName -userprincipalname firstname.lastname@domain. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Set-MsolUserPrincipalName], MicrosoftOnlineException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.InternalServiceException,Microsoft.Online.Adm
inistration.Automation.SetUserPrincipalName- blue-manJan 31, 2018Iron Contributor
Fixed you cannot directly change the domain from one federated domain to the other in O365 - https://answers.microsoft.com/en-us/msoffice/forum/msoffice_o365admin-mso_dirservices/trying-to-change-upn-in-azure-error-unable-to/05759e00-4000-4e7a-bb81-14c6d2152d29?auth=1
- Adam FowlerJan 31, 2018Iron Contributor
That link says you can't do it directly, did you switch it to onmicrosoft.com first then change again?