KB10106 - Exchange: Get mailboxes with forwarding enabled
This article describes how to retrieve Exchange mailboxes that have to option "Forward to:" enabled in Exchange mailflow settings.
The first command retrieves all of those mailboxes, the second one only those mailboxes with a size greater 1MB
Script code:
#get all mailboxes with enabled forwarding
[EMS] Get-Mailbox -ResultSize unlimited | Where-Object {$_.ForwardingAddress -ne $null -and -not $_.DeliverToMailboxAndForward} | Ge
t-MailboxStatistics | Select-Object -Property DisplayName, TotalItemSize
# filter out mailboxes with a size lower then 1 MB
[EMS] Get-Mailbox -ResultSize unlimited | Where-Object {$_.ForwardingAddress -ne $null -and -not $_.DeliverToMailboxAndForward} | Ge
t-MailboxStatistics | Where-Object {$_.TotalItemSize.Value.ToMB() -gt 1} | Select-Object -Property DisplayName, TotalItemSize