Category Archives: Powershell

Exchange 2010 – List Users/Mailboxes That Have Forwarding or Forwarding Rules

Trying to trace how a message came into a users mailbox can be a pain, when it is auto-forwarded via a rule in OWA, to a mailbox that has forwarding enabled, to another mailbox that is redirecting all messages. The easiest way to track this down is to query for which mailboxes and users are forwarding what to where:

Get list of users who have forwarding enabled on their accounts:
Get-Mailbox -Filter { ForwardingAddress -like “*” } | Where-Object { $_.ForwardingAddress -like “*” } | Select-Object Name,ForwardingAddress

 

Get list of users who have forwarding rules configured in their mailboxes:
ForEach ($m in (Get-Mailbox -ResultSize Unlimited)) { Get-InboxRule -Mailbox $m.DistinguishedName | where { $_.ForwardTo } | fl MailboxOwnerID,Name,ForwardTo }

Get list of users who have redirects configured on their mailboxes:
ForEach ($m in (Get-Mailbox -ResultSize Unlimited)) { Get-InboxRule -Mailbox $m.DistinguishedName | where {$_.ReDirectTo} | fl MailboxOwnerID,Name,RedirectTo }