At the company were I worked we had a name change. They also use the display name in outlook to send mail. Example: Daag van der Meer [Company] So everyone see direct what the company is.
The script below built the display name with firstname lastname [Company]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# Script created by Daag van der Meer # Blog.van-daag.nl Import-Module ActiveDirectory #creates a list of all users (change all between <> $allUsers = Get-ADUser -Filter * -SearchBase 'ou=Users,ou=<OU>,DC=<DC>,DC=<DC' -Properties cn,displayName # Add your company name or something else after username $hi = "<company>" foreach ( $u in $allUsers | Where-Object { ($_.givenName) -and ($_.surName) } ) { $fn = $u.givenName.Trim() $ln = $u.surName.Trim() Write-Host $fn $ln Set-ADUser -Identity $u -DisplayName "$fn $ln $hi" -GivenName "$fn" -SurName "$ln"-PassThru | Rename-ADObject -NewName "$fn $ln $hi" } |