I need to put together a list of Mailboxes - specifically the Primary SMTP address - that are forwarding to contacts with a specific domain in the SMTP address. For example, the filter would accept a Mailbox with identity "John Doe" if the Forwarding Address points to a Contact with the primary SMTP address "[email protected]".
I can get the Mailboxes that have a forwarding address set with the following command using the Exchange 2007 Shell.
$forwardingMailboxes = Get-Mailbox | where {$_.ForwardingAddress -ne $Null}
How do I filter $forwardingMailboxes further by accepting only the Mailboxes that are forwarding to Contacts with an SMTP address with a specific domain?