J003-Content-Mail-Forwarding-in-Exchange_SQFrequently, I find the need to set up forwarding of email on mailboxes that exist in a system. I don’t mean creating contacts with remote addresses; I mean I have a mailbox in Exchange that is going to remain in Exchange, but I need to set things up so that mail sent to that mailbox is forwarded on elsewhere. In this post, we will look at how administrators can set up forwarding.

There are two attributes for every mailbox that can control forwarding and which can be manipulated by admins – either Exchange Org Admins or Recipient Admins. Those are ForwardingAddress, and ForwardingSmtpAddress. Let’s look at what each one does.

ForwardingAddress

When you want to forward email sent to one mail-enabled object (MEO) in your organization to another, you can use the –ForwardingAddress attribute to do so. The target of the forwarding must also exist in your Active Directory as another mail-enabled object, such as a Contact, MailUser, or RemoteMailUser. If you don’t have an AD object with an email address, then this parameter won’t work. Use the set-mailbox command to manipulate the value.

-ForwardingAddress <RecipientIdParameter>

The ForwardingAddress parameter specifies a forwarding address.

Required?                    false

Position?                    Named

Default value

Accept pipeline input?       False

Accept wildcard characters?  false

ForwardingSmtpAddress

So that is where ForwardingSmtpAddress comes in. Use this when you want to specify an SMTP address for a remote recipient which does not exist in your Active Directory as an MEO. Again, use the set-mailbox command to manipulate the value.

-ForwardingSmtpAddress <ProxyAddress>

The ForwardingSmtpAddress parameter specifies a forwarding SMTP address.

Required?                    false

Position?                    Named

Default value

Accept pipeline input?       False

Accept wildcard characters?  false

For either of the above attributes, if you want to clear them out, use the set-mailbox cmdlet and set the value to $null, like this.

set-mailbox casper –forwardingsmtpaddress:$null

DeliverToMailboxAndForward

While you may need to forward messages, you probably ought to keep a copy of those messages as well. That can be controlled by the –DeliverToMailboxAndForward attribute. If set to True, it will keep a copy as well as forwarding. If set to False, it will simply forward the message on.

-DeliverToMailboxAndForward <$true | $false>

The DeliverToMailboxAndForward parameter specifies whether messages sent to this mailbox are forwarded to another address. If the DeliverToMailboxAndForward parameter is set to $true, messages are delivered to the mailbox and to the  forwarding address. If set to $false, messages are delivered only to the forwarding address.

Required?                    false

Position?                    Named

Default value

Accept pipeline input?       False

Accept wildcard characters?  false

Blocking forwarding

In case you found this post because you are trying to prevent automatic forwarding, you can do that too. This will stop users, who go into ECP or set up rules in Outlook, from forwarding messages to offsite mailboxes automatically.  In the EMC, go to the Hub Transport configuration, Remote Domains, and clear the checkbox “Allow automatic forward.” Done in one!