My PowerShell

Windows Powershell scripts, examples, tips, docs …

Display Exchange Mailbox SMTP Addresses

Run Get-Mailbox cmdlet to list all mailboxes, with primary SMTP address, and any additional SMTP addresses associated with the mailbox.

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName, Database,SamAccountName, Alias, ExchangeGuid,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | export-csv c:\temp\primary-and-secondary-smtp-addresses.csv

The results will be exported in c:\temp\primary-and-secondary-smtp-addresses.csv

Tagged as:

Leave a Response