Retrieve all mailboxes where forwarding address is enabled

I was recently looking at retrieving all mailboxes where the forwarding address was enabled as part of the delivery options and to return the mailbox name, forwarding address and if the option to deliver message to both the forwarding address and mailbox is enabled and export this information to an output file.

I was able to do this by running the below in the Microsoft Exchange Management Shell:, by retrieving all mailboxes where the object ‘ForwardingAddress’ is not equal to null and by selecting the Name, ForwardingAddress and DeliverToMailboxAndForward objects and exporting to a CSV file.

Get-Mailbox | Where-Object {$_.ForwardingAddress -ne $null} | Select Name, ForwardingAddress, DeliverToMailboxAndForward | Export-CSV D:\Output\ForwardingAddresses.csv -NoTypeInformation
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s