How to change mailbox DisplayNames using imported and then corrected csv file

Hello folks,

I had problems with encoding of some users' DisplayNames. What I did is exported those to csv file, then corrected it.

How can I replace old DisplayNames with new ones using powershell?

It should look at csv file(fields:DisplayName, email), find the mailbox and change DisplayName.

Thank you!

January 8th, 2013 6:27am

Import-CSV users.csv |  Foreach {Get-Aduser -Filter "mail -eq '$($_.email)'" | Set-ADUser -DisplayName $_.DisplayName}
Free Windows Admin Tool Kit Click here and download it now
January 8th, 2013 6:32am

Its not for AD, its for Exchange users.
January 8th, 2013 7:06am

Its not for AD, its for Exchange users.

All exchange accounts are stored in Active Directory and you can manage them using Active Directory cmdlets.
  • Edited by KazunMVP Tuesday, January 08, 2013 7:57 AM
Free Windows Admin Tool Kit Click here and download it now
January 8th, 2013 7:56am

Here is how I think it should work.

Import-Csv 1.csv | Foreach {Get-Mailbox -Filter {EmailAddresses -eq '$($_.email)'}} | Set-Mailbox -DisplayName $_.DisplayName

However it doesn't do what I want. it doesn't rename DisplayName

January 8th, 2013 8:08am

Here is how I think it should work.

Import-Csv 1.csv | Foreach {Get-Mailbox -Filter {EmailAddresses -eq '$($_.email)'}} | Set-Mailbox -DisplayName $_.DisplayName

However it doesn't do what I want. it doesn't rename DisplayName

Get-User,Set-User - Exchange cmdlets

Import-Csv 1.csv | Foreach {Get-User -Identity $_.email | Set-User -DisplayName $_.DisplayName}

  • Edited by KazunMVP Tuesday, January 08, 2013 8:14 AM
  • Marked as answer by Y.Sa Tuesday, January 08, 2013 8:34 AM
Free Windows Admin Tool Kit Click here and download it now
January 8th, 2013 8:14am

Thanks it worked!

Also I put { bracket in the wrong place.

January 8th, 2013 8:35am

Use this command line to set the Display Name using a CSV file that includes columns SMTP and DisplayName:

Import-CSV D:\smtp_displayname.csv | ForEach {Get-Mailbox -Identity $_.SMTP | Set-Mailbox -DisplayName $_.DisplayName}

CSV file is formatted:

SMTP DisplayName
Dixie.Normous@domain.com Normous, Dixie (Company Name)
Yuri.Tards@domain.com Tards, Yuri (Company Name)


  • Edited by IQDENYC 12 hours 35 minutes ago
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2015 2:34pm

Use this command line to set the Display Name using a CSV file that includes columns SMTP and DisplayName:

Import-CSV D:\smtp_displayname.csv | ForEach {Get-Mailbox -Identity $_.SMTP | Set-Mailbox -DisplayName $_.DisplayName}

CSV file is formatted:

SMTP DisplayName
Dixie.Normous@domain.com Normous, Dixie (Company Name)
Yuri.Tards@domain.com Tards, Yuri (Company Name)


  • Edited by IQDENYC Thursday, July 02, 2015 6:33 PM
July 2nd, 2015 6:33pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics