Administratively setting a forward in Exchange Labs using PowerShell

I had a conversation with a customer recently about setting mail forwards administratively.  They had 2 scenarios we discussed…perhaps there are some more you can think of?

One scenario was in the context of a migration to our Exchange Labs service where the institution had a list of all of the email addresses students used (Hotmail, Gmail, Yahoo!, etc). They wanted to provide students with their new Exchange Labs email addresses and set a forward on all of these mailboxes so that mail got delivered in 2 places until such time that students familiarized themselves enough with Exchange Labs to make the permanent switch.  The other scenario was where the institution wanted to investigate all incoming mail to a student’s mailbox without the student knowing that this was happening or being able to turn this off.

Both of these can be achieved using the same method I outline below, but there are some things you should be aware of.

The command to do this in PowerShell, assuming you are pushed onto a runspace is:

Set-Mailbox jackjones -DeliverToMailboxAndForward:$True -ForwardingAddress dannyk

…where jackjones is the mailbox that you want to set the forwarding on, and dannyk is the name of the mailbox/contact/group/etc that you want mail forwarded to.  You can use the mailbox name, the SMTP address, the DN here; I am just keeping it short for convenience.

The key thing to be aware of is that you can only use this command to forward mail to objects that exist in the Exchange Labs Global Address List.  So in the first scenario outlined above, if you wanted to build this instruction into some bigger script that did this forward for 1000’s of users, you would need to ensure that the target email addresses are all in your GAL as mail-enabled contacts first.  So this is not really a great option as you would end up with double entries for every individual you are managing.  A much better way to do this is to tell users to set up their own forwarding through the Outlook Web Access UI or Outlook 2007 interfaces through inbox rules.  For the second scenario, this method would be a much better choice; the setting does not show up in the user interface.

Hope this helps… if options change in the future, I will let you know.


Technorati Tags: ,

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: