Posted on February 9, 2016 · Posted in Exchange

Export Exchange Global Address List (GAL) to CSV

Let’s consider some ways of exporting the Exchange Global Address List (GAL) to a text CSV file. In this format, the contact list from the corporate address book can be transferred and imported into the contacts of third-party email clients or online email services.

Let’s deal with some export tools: these can be Exchange Management Console, Powershell, MS Access or csvde utility. In fact, there are no tools to export Exchange Global Address to any format in MS Outlook. You can export only your personal address book, but it’s quite troublesome to copy all GAL recipients to it.

The easiest way is to export the address book right in the EMC console. To do it, go to Mailbox section and in the right-hand column select Export List. But you need to have access to the Exchange console to do it.

Exchange Management Console - Export List

To get the address list in the domain, you can use the Powershell cmdlet Get-Recipient. For example, our task is to display the list of user names, their SMTP addresses and phone numbers:

Get-Recipient| Select-Object Name,PrimarySmtpAddress, Phone

Powershell Get-Recipient

To display only the Default Global Address List, use this filter:

$filter = (Get-GlobalAddressList 'Default Global Address List').RecipientFilter
Get-Recipient -ResultSize unlimited -RecipientPreviewFilter $filter | Select-Object Name,PrimarySmtpAddress, Phone

To exclude from the list the entries hidden from the address book (HiddenFromAddressLists attribute) and export the list to a CSV file:

Get-Recipient -RecipientPreviewFilter $filter | Where-Object {$_.HiddenFromAddressListsEnabled -ne $true} | Select-Object Name,PrimarySmtpAddress, Phone | Export-CSV c:\exchange\GAL.csv -NoTypeInformation

To import the AD data, you can use a console utility csvde.exe.

The command to display user data with their e-mail addresses can look like this:

CSVDE -r "(&(objectClass=person)(mail=*))" -l displayName,proxyAddresses –f Exchange-GAL.csv

As a result, you get a list like this:


And finally, the least evident, but quite simple and clear way to export GAL for a common user — with the help of Access database.

  1. Run Microsoft Access and select File->Open in its menu
  2. Select Exchange() in file typesConnect Exchange via Access
  3. In the list of sources select Global Address List Import Exchange GAL to Microsoft Access
  4. A flat Access table with the address book info is obtained.
  5. Now you can export it from the database to CSV or Excel file.

It is enough to import the CSV file you got in Excel and modify it as you need.

Related Articles