Sometimes you get a sudden need to forward bulk users’ mail to external destination… in normal days, you would create a mail contact, then forward the selected user’s mail to the new external contact.

Now what if you got a large number of contacts to forward? well, you can either:

  1. Manually create all the required mail contacts, then assign each user to each contact.
  2. OR THE BETTER WAY: Use the magic of PowerShell!

This is a very simple and quick procedure…

First, you will need to create the contacts, which you can find how in the following post: PS: Creating bulk mail contacts

Then with another script, you will forward each user to his corresponding mail contact item:

Import-CSV "C:\ContactForward.csv" | Foreach{Set-Mailbox -Identity $_.LocalUser -ForwardingAddress $_.ForwardAddress -DeliverToMailboxAndForward $true}

You can either keep the attribute “-DeliverToMailboxAndForward $true” to keep a copy of the message in the original mailbox or remove it.

Requirements for this script are simple:

  1. A CSV file contains 2 headers: LocalUser, ForwardAddress, with all the contacts and the local mailboxes list you want to forward.
  2. Save the CSV file in C:\ (to be completely complied with the script above, otherwise save it where you want, but make sure you specify it’s full path in the script above instead of “C:\ContactForward.csv”.

Here is a ready script (with DeliverToMailboxAndForward set to $true) that will only require a CSV file with the above format saved in C:\:

Bulk-MailForward

Also here is the script needed to create the bulk mail contacts in case that was needed:

Bulk-MailContact

No responses yet

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.