27 C
Dubai
Saturday, November 23, 2024

Dump All Proxy Address from Exchange Server

Dump All Proxy Address/Email Addresses from Exchange Server using PowerShell.

Mailboxes –

Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName,Servername,EmailAddressPolicyEnabled,PrimarysmtpAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses | Where-object {$_.PrefixString -ceq "smtp"} |Foreach-object {$_.SmtpAddress}}} | Export-Csv EmailAddresses_MBX_Dump.csv

Distribution Groups –

Get-DistributionGroup -ResultSize Unlimited | Select-Object DisplayName,Servername,EmailAddressPolicyEnabled,PrimarysmtpAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses | Where-object {$_.PrefixString -ceq "smtp"} |Foreach-object {$_.SmtpAddress}}} | Export-Csv EmailAddresses_DG_Dump.csv

Mail Contacts –

Get-MailContact -ResultSize Unlimited | Select-Object DisplayName,Servername,EmailAddressPolicyEnabled,PrimarysmtpAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses | Where-object {$_.PrefixString -ceq "smtp"} |Foreach-object {$_.SmtpAddress}}} | Export-Csv EmailAddresses_Contact_Dump.csv

you can create a CSV as below,

image

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a Technical Advisor for various start-ups.

Related Articles

2 COMMENTS

  1. You can try also:

    Get-Recipient -ResultSize Unlimited | Select-Object RecipientType, DisplayName,Servername,EmailAddressPolicyEnabled,PrimarysmtpAddress,EmailAddresses | Export-CliXml RecipientsDump.xml

    does almost the same. Import-CliXml allows to work “offline” with this dump then.

  2. This doesn’t work for exchange online. Any way to make it work for Exchange Online where it will dump the proxy addresses?

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?