Change a User’s DisplayName on Office 365 with PowerShell
-
Originally posted on my Windows Administration blog in 2013 here: http://web.archive.org/web/20130929034913/http://www.scottalanmiller.com/windows/2013/04/13/change-a-users-displayname-on-office-365-with-powershell/
Assuming that we are starting with the email address of a user in Office 365 (also known as their “UserPrincipalName”) we can easily look up a user’s current DisplayName and change it using PowerShell. Assuming that your PowerShell is already connected to your Office 365 we can do a lookup via the “getter” command:
Get-MsolUser -UserPrincipalName [email protected]
This will return a simple table of email address, DisplayName and isLicensed. If we want to change the DisplayName property (assuming perhaps that it was misspelled when it was first entered) we can using the matching “setter” command like this:
Set-MsolUser -UserPrincipalName [email protected] -DisplayName "Garfield"
To verify run the original “getter” command again.