Wednesday, May 29, 2013

Changing a name in SharePoint People Picker using PowerShell

The company I work for has recently acquired another business, and the migration process for getting their Active Directory users into our Active Directory has resulted in duplicate accounts for the same person. Sometimes the duplicate account is on a different domain, but often it's the same domain, resulting in confusion when there is a need to select a user from the People Picker.

One option to resolve this is to simply delete the SPUser.  However, I don't like deleting things.  There is always a chance this could have adverse effects somewhere else, and there's also the higher chance that the SPUser will just be recreated when something occurs in the Active Directory.  So, I've opted for another solution, which is to simply change the DisplayName of that erroneous account to something obvious (such as "Do not use").

Eventually, these duplicate accounts will be deleted from the Active Directory, which makes me more confident in deleting the SPUsers too, but until then, this will have to do.

Set-SPUser -Web http://sharepoint -Identity "domain\duplicateuser" -DisplayName "Do Not Use"

No comments:

Post a Comment