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

Follow

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 jjones@emailaddress.com -userprincipalname jsmith@emailaddress.com.

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

Comments

  • 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 oldname@foo.onmicrosoft.com. 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 SIP:email@address.com value, and you should be able to update smtp:oldname@foo.onmicrosoft.com 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 newalias@domain.onmicrosoft.com 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 oldalias@domain.onmicrosoft.com. Also i am looking to see if the Synchronize userPrincipleName Updates can be used to avoid the steps in your article :-) https://docs.microsoft.com/en-us/azure/active-directory/connect/active-directory-aadconnectsyncservice-features (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