Set forwarding address for everyone.


Short but useful script to set forwarding email address for every user in your Office 365 tenant. Can be useful for example if a company have been acquired, and the new owners want them to use theire email domain. Forwarding can then be a good temporary/quick fix to catching all emails to the old domain.

$Mailboxes = Get-Mailbox | Select-Object identity,alias
Foreach($Mailbox in $Mailboxes) {
    $MailAlias = $Mailbox.alias
    Set-Mailbox -identity $Mailbox.identity -ForwardingSMTPAdress $MailAlias+""

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s