This process can be reused to add (not overwrite, just append) any type of email address to a list of users. All you need is a simple CSV file with 2 rows, SamAccountName and the new email address. The example I’ve used is an X500 address, but this could be X400: or SMTP. Remember when adding an SMTP address, case sensitivity matters!
smtp:bruce.wayne@wayneenterprises.co.uk = secondary email alias
SMTP:batman@batcave.co.uk = primary email address
SAM | |
brucewa | X500:/O=WAYNE ENTERPRISES/OU=First Administrative Group/cn=Recipients/cn=brucewa |
harleyqu | X500:/O=WAYNE ENTERPRISES/OU=First Administrative Group/cn=Recipients/cn=harleyqu |
poisoniv | X500:/O=WAYNE ENTERPRISES/OU=First Administrative Group/cn=Recipients/cn=poisoniv |
Once you have your lovely CSV file in a location on the Exchange server, crack open the Exchange Management Shell and run this command:
Import-Csv C:\migration\x500.csv | ForEach-Object{ $name = $_.SAM $proxy = $_.email Set-Mailbox -Identity $name -EmailAddresses @{add= $proxy} }
Tada!