Skip to content

PowerShell script to perform bulk adding of new SMTP addresses to Office 365 mailboxes

License

Notifications You must be signed in to change notification settings

BJD1997/Add-SMTPAddresses.ps1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Add-SMTPAddresses.ps1

PowerShell script to perform bulk adding of new SMTP addresses to Office 365 mailboxes.

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.

Results are output to a text log file.

Modifications made by me (BJD1997)

  • -Check if Exchange Online managemet module is installed, if not install it.
  • -Check if there is an active connection with Exchange Online, if not the run Connect-ExchangeOnline

Parameters

  • -Domain, The new domain name to add SMTP addresses to each Office 365 mailbox user.
  • -MakePrimary, Specifies that the new email address should be made the primary SMTP address for the mailbox user.
  • -Commit, Specifies that the changes should be committed to the mailboxes. Without this switch no changes will be made to mailboxes but the changes that would be made are written to a log file for evaluation.

EXAMPLES

.\Add-SMTPAddresses.ps1 -Domain office365bootcamp.com

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

.\Add-SMTPAddresses.ps1 -Domain office365bootcamp.com -MakePrimary

This will perform a test pass for adding the new [email protected] as a primary email address to all mailboxes. Use the log file to evaluate the outcome before you re-run with the -Commit switch.

.\Add-SMTPAddresses.ps1 -Domain office365bootcamp.com -MakePrimary -Commit

This will add the new [email protected] as a primary email address to all mailboxes.

.\Add-SMTPAddresses.ps1 -Domain office365bootcamp.com -Commit

This will add the new [email protected] as alias email address to all mailboxes.

More Information

https://practical365.com/add-smtpaddresses-ps1-bulk-add-smtp-addresses-to-office-365-mailbox-users/

Credits

Written by: Paul Cunningham

Modified by: Bauke-Jan Davids

Find me on:

Additional contributors:

Additional references:

About

PowerShell script to perform bulk adding of new SMTP addresses to Office 365 mailboxes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%