Tuesday, November 12, 2013

Update Display Name, Name, Initials etc–PowerShell Script

Here is a PowerShell V2.0 script which you can use to update Display Name, Name, Initials etc.  Of course you can change or select different attributes as needed.  You can get attribute derails from here - http://portal.sivarajan.com/2010/07/aduc-and-ldap-reference-sheet.html

In this script, I am updating display name in LastName, FirstName (Initial) format.  Initial is the first characters from First and Last name.  You can change this logic by modifying the following code:

$Ufname = $Uinfo.GivenName
$ULname = $Uinfo.Surname
$CurrentDispalyName = $Uinfo.Displayname
$NewInitial = $Ufname[0]+$ULname[0]
$NewInitial = $NewInitial.toupper()
$NewDisplayname = $ULname + ", " + $Ufname + " (" + $NewInitial + ")"

Also, I am using an input file with samaccountname.  You can select an OU instead of an input file.


Output file (DisplayName_Output.txt) will have the Current Display Name, New Display name and New Initials information.

Script  can be downloaded from the following location:



Post a Comment

Popular Posts


Twitter Delicious Facebook Digg Stumbleupon Favorites More