How to Export the Exchange 2010 Default Global Address List (GAL)
How to Export the Exchange 2010 Default Global Address List (GAL)
Looking to export your Exchange 2010 default global address list (GAL) to an external file? This is supported natively right from the Exchange Management Console (EMC). Just navigate to the Recipient Configuration node in EMC, and select the recipient type. Then from the actions pane, you can select the "Export List" option and dump the data out to a CSV or text file.
You can also customize the fields. Before exporting using EMC, you'll want to go up to View > Add Remove Columns and choose which properties you want in your file. Keep in mind that with this method, you'll need to go to each recipient type, such as mailbox, distribution group, mail contact, etc. and export your list.
Another option is the Exchange Management Shell. If you take a look at the default global address list, you'll notice it already has a filter defined:
You can use this filter to generate your report using the Get-Recipient cmdlet. This takes mailboxes, contacts, groups, and mail-enabled public folders into account for you.
To generate a report using this filter, use the following:
1 2 3 | $filter = (Get-GlobalAddressList 'Default Global Address List').RecipientFilter Get-Recipient -RecipientPreviewFilter $filter | Select-Object Name,PrimarySmtpAddress | Export-CSV c:\GAL.csv -NoTypeInformation |
You might also want to filter out recipients that have the HiddenFromAddressLists enabled property set to true. You could modify the filter, or you could just use Where-Object and do it after the fact:
1 2 3 | $filter = (Get-GlobalAddressList 'Default Global Address List').RecipientFilter Get-Recipient -RecipientPreviewFilter $filter | Where-Object {$_.HiddenFromAddressListsEnabled -ne $true} | Select-Object Name,PrimarySmtpAddress | Export-CSV c:\GAL.csv -NoTypeInformation |
It will be a lot faster, especially in environments with lots of mailboxes, if you use a server side filter to exclude those hidden recipients:
1 2 3 | $filter = "((Alias -ne `$null) -and (HiddenFromAddressListsEnabled -ne `$true) -and (((ObjectClass -eq 'user') -or (ObjectClass -eq 'contact') -or (ObjectClass -eq 'msExchSystemMailbox') -or (ObjectClass -eq 'msExchDynamicDistributionList') -or (ObjectClass -eq 'group') -or (ObjectClass -eq 'publicFolder'))))" Get-Recipient -RecipientPreviewFilter $filter | Select-Object Name,PrimarySmtpAddress | Export-CSV c:\GAL.csv -NoTypeInformation |
What you should end up with is something you can open in Excel that looks like this:
You can select additional properties if needed, just add them when calling Select-Object. Also, you may want to dump this data out to HTML. If that is the case, replace Export-CSV with ConvertTo-Html and redirect the output to a file with a .html extension. Finally, keep in mind that the Get-Recipient will return 1000 objects by default. You can override this by setting its -ResultSize parameter to a specific value, or to Unlimited.
Enjoy!
Mike Pfeiffer – Microsoft MVP
Director of Unified Communications
Interface Technical Training
You May Also Like
EMC, EMS, Exchange, Export, GAL, Global Address List, Powershell
A Simple Introduction to Cisco CML2
0 3703 0Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2
How to Build in a PSMethod to your PowerShell Code
0 68 0In this video, PowerShell instructor Jason Yoder shows how to add Methods (PSMethod) to your code using free software that’s added into the PSObject. For instructor-led PowerShell courses, see our course schedule. Microsoft Windows PowerShell Training Download the Building Methods PowerShell script</a> used in this video. <# ╔══════════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ Building Methods ║ ╟──────────────────────────────────────────────────────────────────────────────╢ … Continue reading How to Build in a PSMethod to your PowerShell Code
How to use the PowerShell ConvertFrom- CSV Cmdlet to Save Coding Time with PS Script
0 322 4In this video, PowerShell instructor Jason Yoder shows how to use the ConvertFrom-CSV PowerShell Cmdlet to easily convert standard CSV files into PowerShell objects and speed up coding time. For instructor-led PowerShell training classes, see our course schedule: Microsoft Windows PowerShell Training PowerShell ConvertFrom-CSV script used in this video. Download ConvertFrom-CSV PowerShell Script <# ╔══════════════════════════════════════════════════════════════════════════════╗ … Continue reading How to use the PowerShell ConvertFrom- CSV Cmdlet to Save Coding Time with PS Script
See what people are saying...