This PowerShell script will add new SMTP addresses to existing Office 365 mailbox users for a new domain. This script fills the need to make bulk email address changes in Exchange Online when Email Address Policies are not available.

Examples:

This will perform a test pass for adding the new alias@office365bootcamp.com as a secondary email address to all mailboxes. Use the log file to evaluate the outcome before you re-run with the -Commit switch.

 

PowerShell
Edit|Remove
.\Add-SMTPAddresses.ps1 -Domain office365bootcamp.com
This will perform a test pass for adding the new alias@office365bootcamp.com as a primary email address to all mailboxes. Use the log file to evaluate the outcome before you re-run with the -Commit switch.
PowerShell
Edit|Remove
.\Add-SMTPAddresses.ps1 -Domain office365bootcamp.com -MakePrimary
 This will add the new alias@office365bootcamp.com as a primary email address to all mailboxes.
PowerShell
Edit|Remove
.\Add-SMTPAddresses.ps1 -Domain office365bootcamp.com -MakePrimary -Commit
 
More information about Add-SMTPAddresses.ps1 is available on Exchange Server Pro. Please leave comments or questions there, or raise issues on Github.