Powershell to export list of email forwards on an Exchange Server

this will list all the forwards that are active for mailboxes.


$fwds = get-mailbox | Where-Object { $_.ForwardingAddress -ne $null } | sort Name | select Name, ForwardingAddress

# now get the primary smtp adress of each forward address
foreach ($fwd in $fwds) {
$fwd | add-member -membertype noteproperty -name "ContactAddress" -value (get-Recipient $fwd.ForwardingAddress).PrimarySmtpAddress
}

$fwds | export-csv -path all_forwards.csv

About Jeff Turner

Technical director of Nano Tera Network Solutions.
This entry was posted in Hints and Tips, Powershell, VBS, VBA and other scripting. and tagged , . Bookmark the permalink.