SharePoint contains a User Information List in the Root Web of every Site Collection which contains a number of properties about the users.
The properties include:
- Display Name
- SIP Address (Used by OCS/Lync Presence)
- Job Title
- First Name
- Last Name
- Work Phone
- User Name
This List is used in a number of different places in SharePoint, such as workflows/alerts, custom applications, People Picker and many more. This List is supposed to be updated by a User Profile Service Timer Job. I have rarely seen this function work in a Production environment.
When this list becomes out of date, a number of issues could occur:
- Alerts/Workflow Email sent to the wrong email
- Assigning permissions to the wrong user
- Custom Application relying on this information may behave incorrectly
- The users Display Name in SharePoint may be wrong, it may be domain\alias or a random name
I have created this script which syncs all of the properties in the User Information List to the data in the User Profile Service. There are other scripts out there which will query AD for every user. I would not recommend running these scripts as you will be querying AD thousands of times as each Site Collection potentially contains similar users. Furthermore, the Set-SPUser command which they rely on only syncs the Display Name.
- User Profile Service with Synchronization working
- User Profile Service must be connected to the Central Administration Web Application
- The Account running the script must have Rights to the User Profile Service and all Site Collections
Download the script HERE!
If you have any questions please leave a comment.
fix display name displayname script repair username domain UPS service sharepoint 2010 sharepoint 2013 synchronize change name update displayname set-spuser -syncad powershell