Here’s a handy script to give you a list of all Email Addresses for all Exchange Mailboxes. This power shell script works both in Exchange 2007 and Exchange 2010.
- To execute the script, copy the code below and save it as a .ps1 file.
- Open up the Exchange Management Shell and cd to the directory where you saved the powershell script.
- Run the script by typing .\script.ps1
- To save the output to a file run it as .\script.ps1 > output.txt
Here’s the Script:
Get-Mailbox | select name , alias ,EmailAddresses | foreach {
"Name: "+$_.name
"Alias: "+$_.alias
$_.EmailAddresses | foreach {
if($_.SmtpAddress){
if($_.IsPrimaryAddress){
"Primary SmtpAddress: $($_.SmtpAddress)"
} else {
"SmtpAddress: $($_.SmtpAddress)"
}
}
}
write-host
}
Drop me a line if this has helped you!

#1 by Ron on January 17, 2012 - 12:02 PM
Worked great!
Used it on my Exchange 2010 server to list all users and their email addresses. Since quite of few of my users have multiple email addresses it allowed me to list all of them.
I then copied the output into a Word Document, did a REPLACE and searched for NAME: and replaced it with ^p^pNAME: so that there were two spaces between every “user”.