Tuesday, November 1, 2016

New blog!


Hi, I'll start to blog seriously so I decided to go for a new blog at cdanvergara.com to post about Microsoft Cloud Solutions.
I just want to thank you all that visited this site.


I'll post often there so stay tuned!

Cristian

Photo credit: Theophilos via Foter.com / CC BY-NC-ND

Sunday, May 29, 2016

Office 365 error changing UPN

Error message: Set-MSOLUserPrincipalName : Unable to complete this action. Try again later.

PROBLEM

If you try to change the UPN for a user at the Office 365 PowerShell, you can get the following error message:



WORKAROUND

This issue happens when you have multiple domains validated in Office 365, if you try to change the UPN from one public domain to another in some cases that won't work.

In this case something like domain1.com to domain2.com

In previous versions of Office 365 tenants, this command was designed to change the UPN from/to the default Office 365 domain like @domain.onmicrosoft.com.

So the solution is to first change the UPN of the user to something like user@domain.onmicrosoft.com

The command will be:

Set-MSOLUserPrincipalName -UserPrincipalName user@domain.com -NewUserPrincipalName user@domain.onmicrosoft.com

And after that run the command again to change the UPN again to the desired domain:

Set-MSOLUserPrincipalName -UserPrincipalName user@domain.onmicrosoft.com -NewUserPrincipalName user@domain2.com

And voilà: