Export list of all Exchange email addresses and aliases

Issue: You need to get a list of all the email addresses (aliases) in your Exchange environment.

Method 1: Export list of all email addresses to a .CSV file using Exchange Management Shell (EMS):
Get-Mailbox -ResultSize Unlimited -OrganizationalUnit “OU=Phoenix Users,OU=Phoenix,DC=CONTOSO,DC=COM” |Select-Object DisplayName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-CSV c:\exportsmtp.csv -NoTypeInformation

– The “-Organizational” will optionally scope the export to a specific OU. You can leave that out if you choose.
– “EmailAddresses” displays any secondary SMTP addresses assigned to the mailbox
– You will need to modify the OU Structure and Domain in the command and replace it with your own.

Method 2: Output all email aliases to a txt file using ldifde utility:
ldifde -f c:\emailaddresses.txt -d “dc=contoso,dc=com” -l proxyaddresses -r “(proxyaddresses=*smtp:*@*)”

Method 3: If you prefer to use the GUI, Aaron Evans over at Workend IT Blog has simple and easy method of exporting exchange aliases using the Exchange Management Console.


10 thoughts on “Export list of all Exchange email addresses and aliases

  1. ZoomZoom

    Does anyone know of a way to export to CSV the names of all the Dynamic Distribution Lists that have the ‘RequireSenderAuthentication’ set to false.

  2. Ed

    Is there any way to have it delimit the aliases more clearly, or even have multiple columns for them? I’m trying generate a report for fixing inaccuracies in one of our systems, and being able to report on the accuracy would require that the aliases can be separated.

    1. Chris Harris Post author

      I think you could load up the .CSV into excel and manipulate as you see fit. I would try all three methods of exporting the aliases to see which export type works best for you.

  3. Charles

    The output is to keep the users and their respective assets together as much as possible. Then the last person from the source can manage it until it is moved to O365. When something is moved to O365 it is not accessible from the old 2007 users.

  4. Charles

    I need a script that will have the Primary and Alias email addresses along with all their associated objects such as a shared mailbox, Resource, Equipment etc. creating a CSV. A Shared Access List
    We are migrating to Office 365 from Exchange 2007 with a 2013 hybrid CAS. As we move the users need to be grouped together “As much as Possible” and I need a spreadsheet for us to go by.

    1. Chris Harris Post author

      Hi Charles, if you’re running Hybrid mode I would imagine you are using DirSync (Directory Synchronization) and that would sync your AD account and mailbox details, in which case a spreadsheet or CSV is only required for perhaps your own record keeping or tracking. Is this an accurate summary of your plan? If you are executing a migration scenario where mailboxes have to be created in 365 using CSV, I do have some advanced powershell scripts I have developed for account creation that I’ve used on large projects or when dealing with account/mailbox creation-automation. Reply here or get in touch via the about page if you’d like to discuss.

      1. Ed

        I actually got it figured out, thanks. I was pulling it into a SQL database for matching and comparison, and used a SQL based solution to split them in a view.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.