Change a SharePoint User Display Name with PowerShell

Jonathan Browne
By | Updated October 19, 2017 | 3 min read
Change a SharePoint User Display Name with PowerShell

There can be many reasons why you may want to change the displayed SharePoint user display name given to a user in SharePoint. You may also wish to find what the SharePoint user account identity is. Here are two primary scenarios for when you may want to change the SharePoint user display name.

 

Scenario One

The scenario is that SharePoint pulls the display name value from the active directory. Sometime later, a change to this display name is made in Active Directory and you do not see the change filtering up to the user profile in SharePoint.

 

Scenario Two

Your Active Directory display name contains a comma which is a common list separator property. An Active Directory display name may also contain certain characters like [ ]. A list separator and other certain characters are not allowed in a SharePoint user display name when using the Microsoft Project Professional Synchronisation Service with SharePoint. The list separator splits a single resource name into two separate resources on the Microsoft Project resource sheet. Other characters can cause errors and lack of functionality.

 

 

Find the SharePoint User Account Identity

For the script to run, you will need to know the SharePoint user account identity. If you are unsure what the SharePoint user account identity is, you can locate this in SharePoint. You can also use these steps to validate the change.

  • Go to Site -> Site Settings.
  • Under, Users and Permissions, select People and Groups. People and Groups
  • Locate a group that the user is in e.g. Members. SharePoint user display name
  • Click on the name of the user to find the user’s information.
  • In there, you will see the account name to use in the script to change the SharePoint user display name. SharePoint user account identity

 

 

Change SharePoint User Display Name

To resolve the issues in the scenarios above, you change the SharePoint user display name with PowerShell. You have to be either on the SharePoint server or use the PSSession module (PSRemote) in PowerShell.

Run PowerShell as administrator on your and call the SharePoint snapin if you are not using the Management Shell prompt. For this, you will use the Set-SPUser. All you need to specify is the account(identity), the new display name you want, and the site.

Set-SPUser -Identity ‘accountname’ -DisplayName ‘newdisplayname’ –Web https://domain/sites/name

Example:

Set-SPUser -Identity ‘i:0#.w|domainjbloggs’ -DisplayName ‘Joe Bloggs’ –Web https://domain/sites/pso

 

  • Note: the prefix used in your environment may be different e.g.
    Claims based Authentication prefix i:0#.w|
    Forms Based Authentication prefix i:0#.f|

 

 

Original post from 28 Mar 2014

 

BrightWork Services for SharePoint

Jonathan Browne
Jonathan Browne

Don't forget to share this post!