Exchange 2010 list mailboxes with forward to address or inbox rule

This post is also available in: Polish

 

Exchange 2010 mailboxes list with forward to address enabled:

Many times in our Exchange 2010 environment we need to forward messages from one mailbox to another.
Users always have a lot of reasons to enable Forward To option.

After a while we mostly forget which mailbox has enabled Forward To option, and we forget to disable it.

Every now and then we should check, which mailbox has Exchange 2010 Forward To option enabled and if we don’t need it anymore, disable it.

We will spend a lot of time If we would like to use Exchange Mangement Console to verify mailbox Forward To.

Much better option is to use Exchange Management Shell with Get-Mailbox CMDlet.

To get list of all mailboxes in Exchange 2010 with enabled option Forward To we need to run below command:

Get-Mailbox -server MX01 -Filter {ForwardingAddress -like '*'} | Select-Object Name, ForwardingAddress

 

As a result we will get list of all mailboxes on MX01 Exchange 2010 server with Forward To option enabled.
When we have many mailboxes we can write this list to file like below:

Get-Mailbox -server MX01 -Filter {ForwardingAddress -like '*'} | select-object Name,ForwardingAddress | Export-Csv "D:\Scripts\Forwarding.csv"

 

 

Exchange 2010 list of mailboxes with enabled InboxRule:

Normal user can’t enable Forwad To option for mailbox, but he can create in Outlook or OWA InboxRule which will forward or redirect emails to other mailbox.

All mailbox rules created by users are stored in Exchange 2010 mailboxes. So again from Exchange Management Shell we can check all mailboxes do they have any mailbox rules and if they have are they using to forward or redirect messages.

To check mailbox for user created Inbox Rules with option Redirect To or Forward To we need to use Get-InboxRule CMDlet like below:

Get-InboxRule -Mailbox "James Bond" | where {$_.RedirectTo} | fl MailboxOwnerID, RedirectTo

or

Get-InboxRule -Mailbox "James Bond" | where {$_.ForwardTo} | fl MailboxOwnerID, RedirectTo

 

If James Bond has enabled InboxRule with option Redirect To or Forward To then we will get information about mailbox address where messages are redirected.

To check all mailboxes on Exchange 2010 server MX01 we need to run below commands:

Set-AdServerSettings -ViewEntireForest $True
$mbxs = Get-Mailbox -server MX01 -ResultSize Unlimited 
ForEach ($mbx in $mbxs){
 Get-InboxRule -mailbox $mbx.primarySMTPAddress | where {$_.ForwardTo -or $_.RedirectTo} | fl MailboxOwnerID, ForwardTo, RedirectTo 
}

 

 

Print Friendly
Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>