This page looks best with JavaScript enabled

List all valid email addresses in Exchange 2007

 ·   ·  ☕ 1 min read

You may need these to configure your 3rd party antispam software/appliance.

There were lots of articles on the internet with complicated solutions, which did not work for me. Here a Powershell one-liner for Exchange management shell:

1
Get-Mailbox | foreach { $_.EmailAddresses | foreach { $_.SmtpAddress } }

Within regular Powershell, add this line at the very start:

1
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin

If you plan to run it as a batch job, the whole script could look like the following:

1
2
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
Get-Mailbox | foreach { $_.EmailAddresses | foreach { $_.SmtpAddress } } > emails.txt

Victor Zakharov
WRITTEN BY
Victor Zakharov
Web Developer (Angular/.NET)