Extract a list of email addresses from exchange using powershell

Sometimes it may be necessary to extract a list of all email addresses on an exchange server. The most convenient way to do this is with a simple powershell command which will extract the email addresses into a CSV file saved in the root of the C drive. 

 

In order to do this, Run exchange powershell with elevated privileges and then copy in the following command: 

 

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-CSV c:\smtp.csv -NoTypeInformation

Have more questions? Submit a request

1 Comments

Please sign in to leave a comment.
Powered by Zendesk