Add new smtp/set prmary (modification of post by Ermias view diff)
diff | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1714"></script>download | new post
Add new smtp address from csv and set new address primary
- #alias,addnewemailaddress
- import-csv .\source.csv | foreach {
- $user = Get-Mailbox $_.alias
- $user.emailAddresses+= $_.addnewemailaddress
- $user.primarysmtpaddress = $_.addnewemailaddress
- Set-Mailbox $user -emailAddresses $user.emailAddresses
- set-Mailbox $user -PrimarySmtpAddress $user.primarysmtpaddress
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository