When you begin a migration you may require to set mailbox forwarding in Office 365 so that all email that gets sent to the mailbox hosted on Office 365 goes somewhere else. Maybe an on-premise server or some other alternative.
Two ways to set mailbox forwarding in Office 365
There are two ways to do so, one is meant more for an end user and this can be done via Outlook Web App (OWA) using the normal interface and is documented in Forward Email From Office 365.
An administrator can also use this technique too but it isn’t practical if you need to do it for many users. In this case you need to turn to trusty Powershell.
So open up a Powershell window (if you don’t have it set up then read The Basics of Office 365 Powershell) and run the following commands to give you access to the full set of cmdlets:
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Once you have got through all that good stuff and entered you admin username and password you can actually do the deed.
There are two useful options here. The first sets the mailbox to foward but doesn’t keep a copy so when you look in the mailbox it will always be empty and then the second which does keep a copy. Make sure you pick the right one.
- Set-Mailbox email@example.com –ForwardingSmtpAddress firstname.lastname@example.org –DeliverToMailboxAndForward $false
- Set-Mailbox email@example.com –ForwardingSmtpAddress firstname.lastname@example.org –DeliverToMailboxAndForward $true
You can run hundreds or thousands of these commands to turn forwarding on for all your mailboxes if you so wish at the same time.
Eventually you will probably want to turn the Office 365 mailbox forwarding off. At that point you just need to run the following command:
Set-Mailbox email@example.com –ForwardingSmtpAddress $null
If you found this post useful then please link to it or comment for us. We like feedback!