In Exchange/O365, there is multiple ways to set an auto-forward to an external email address :
- Create a contact and set a forward on the mailbox (GUI or PowerShell) to this contact
- Fill the parameter “ForwardingSMTPAddress” on the mailbox with the external email address (Powershell)
- The command looks like this : “Set-Mailbox MailboxForwardFrom -ForwardingSMTPAddress EmailAddressForwardTo@domain.com”
- Fill the AD attribute “targetAddress” with the external email address (Exchange on-premise only)
The first choice will work for both O365 and Exchange directly. The third one will also work directly in Exchange on-premise.
But the second choice will work directly only on O365. That is because, in O365 the remote domain “*” is already created with the AutoForwardEnabled property so AutoForward will work for any external domains. In Exchange, this remote domain is not created by default so you have two options :
- You can create a remote domain with “*” and the property AutoForwardEnabled which will enable the auto forward for any external domains
- You can create a remote domain per external domain in order to control this feature.
To create the remote domain, use the following command (AutoForward is enabled by default) :
“New-RemoteDomain -Name ExternalDomain -DomainName somedomain.com”