Writing a basic script
There are times when, as an administrator, you need secondary SMTP addresses to be added to mailboxes.
You can use a .csv file to list all the users with their alias and new e-mail addresses in the following format and save it as the E-mailAddresses.csv
file:
alias,e-mailaddress hollyh,[email protected] amya,[email protected] susanb,[email protected]
Then, use the following command either directly on Exchange Management Shell or save it in a .PS1
file:
Import-Csv c:\Scripts\E-mailaddresses.csv | Foreach{set-mailbox -identity $_.Alias -E-mailAddresses @{add=$_.e-mailaddress}}