The following command can be used to generate a list of all of your users, displaying all aliases for each user. This is helpful when trying to track down an email address that you know exists, but don’t know which mailbox it is configured on:
get-mailbox | select -expand emailaddresses alias
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 }
Bring me the butter, baby!