swolff1
asked on
forward Exchange 2010 mailbox to an external mailbox in Power Shell
Hello,
I need to forward several mailbox in Exchange 2010 to external mailboxes and looking for a reliable script rather then configuring mail "Contact" and then forwarding. I will have several hundred mailboxes to forward soon.
Thank you in advance,
Sig
I need to forward several mailbox in Exchange 2010 to external mailboxes and looking for a reliable script rather then configuring mail "Contact" and then forwarding. I will have several hundred mailboxes to forward soon.
Thank you in advance,
Sig
The reason a MailContact is generally used for forwarding purposes in Exchange is because you can't set forwarding on a mailbox on the server level to a domain that isn't configured as an Accepted Domain. How many different external addresses are you forwarding to?
Here is an example of the one-liner you can run to configure forwarding:
Here is an example of the one-liner you can run to configure forwarding:
Set-Mailbox <mailbox> -ForwardingAddress user@externaldomain.com -DeliverToMailboxAndForward $false
Can you give more detail, what exactly you are looking. Are you trying to forward specific email or all emails. Did you enable forward option at org level?
ASKER
Potentially there are around 700 mailboxes that I need to forward to an External (not accepted) domain.
I can generate .csv file with a list of all the forwarding (target) email addresses but this will be done in stages and would require several .csv files. I hope that answers your question.
Thank you.
I can generate .csv file with a list of all the forwarding (target) email addresses but this will be done in stages and would require several .csv files. I hope that answers your question.
Thank you.
ASKER
Hello Jason,
Just tested a script that you provided and it only works if I have an existing "Mail Contact" in place, without Contact it doesn't work for me.
Thanks.
Just tested a script that you provided and it only works if I have an existing "Mail Contact" in place, without Contact it doesn't work for me.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for your reply. Once forwarding is setup, what's the command to stop forwarding if I need.
Just remove forwarding address.
Import-Csv C:\users.csv | ForEach{Set-Mailbox $_.alias -ForwardingSMTPAddress $null}
Import-Csv C:\users.csv | ForEach{Set-Mailbox $_.alias -ForwardingSMTPAddress $null}
ASKER