Tuesday, November 4, 2008

Update GAL Display Name - powershell

We recently decided to change on how our Global Address list is displayed from using the format to the , format.

Powershell made quick work of this task and took about 10 minutes with 2500 users. Here's the script.

###=====================================
### Update Exchange Global Address List Display
### - Matt Brown, 2008
###=====================================
$Users = Get-User -ResultSize unlimited |
where {
($_.RecipientTypeDetails -eq "MailUser")
-or ($_.RecipientTypeDetails -eq "UserMailbox")
}

ForEach ($Person in $Users) {
$NewName = $User.LastName + ", "
$NewName += $User.FirstName + " "
$NewName += $user.Initials

# get rid of trailing spaces caused by blank initials
$NewName = $NewName.Trim()
Set-User $User -Name $NewName -DisplayName $NewName
$NewName = $Null
}


Don't forget to update the OAB after this is done so your outlook clients will update.

No comments:

Post a Comment