How do I change the sign-in name for an AD-synchronized user?


Here's the situation:

We attempted to change an employees name from Jane Smith to Jane Jones. We made the changes on our local AD and synched them O365. O365 still showes the user name as "jsmith". The online (and offline) GAL still shows a last name of Smith and an alias of "jsmith".

What did we do wrong? How can we get Jane's new name change to appear on O365?

The solution:

The answer is that you didn't do anything wrong. If your users are not synchronized from Active Directory, you can change the sign-in name from the details page in Office 365. However, for AD-synced environments, the sign-in name (username) needs to be changed via PowerShell once an Office 365 license is assigned, and here's how you change the username:

  1. Start PowerShell
  2. Make sure the Microsoft Online module is loaded (if you're using the MS Online Helpdesk PowerShell profile, that module will be loaded for you automatically)
  3. Execute the following command:

set-msoluserprincipalname -newuserprincipalname -userprincipalname

This will change the sign-in name and should help resolve any sync issues. To change the GAL display name, make sure that the displayName property in Active Directory is updated (in addition to Last Name) and either force the directory sync or wait for changes to sync during the next sync window.

Have more questions? Submit a request


  • Avatar
    Alex Balcanquall

    Hi I needed this today, thanks for posting it was a real help.
    However this leaves a inconsistency with respect to Skype4B login as old user principle and the smtp alias of How do I change these (once can't edit the smtp alias for onmicrosoft in any of the office or exchange portals

  • Avatar
    Ilya Lehrman

    Alex, assuming you're synchronizing from Active Directory, find the email addresses attribute on the user's profile. The Skype address is controlled by value, and you should be able to update there as well.

    Edited by Ilya Lehrman
  • Avatar
    Alex Balcanquall

    Thanks Ilya, yes synchronizing from AD. Interestingly the Skype address corrected itself after an hour or two.

    The onmicrosoft SMTP aliases are different matter, i spent 2 hours with good MS support person and the best we could do was add and we could not remove the old alias. We added the new alias by using the account username dropdown to toggle the username domain. They are researching how to change the Also i am looking to see if the Synchronize userPrincipleName Updates can be used to avoid the steps in your article :-) (on my system SynchronizeUpnForManagedUsers was not set to true, though on more recent accounts it is enabled by default apparently - as proven by my work AD which is newer and has this enabled)

    Edited by Alex Balcanquall
Powered by Zendesk