Then you can export Outlook contacts to CSV via Import-Export feature ( File -> Open & Export -> Import/Export). The only workaround for exporting GAL content to a file is to add all recipients from the organization’s address book to the personal Contacts list ( Address Book –> Global Address List -> CTRL+A -> Add to contacts). You cannot export the contents of the Global Address List directly from Outlook. If you don’t have privileged permissions in Exchange, you can export the organization’s global address list from the user’s computer using programs from MS Office/Office 365. Export Global Address List from Outlook or Access Get-Recipient -RecipientPreviewFilter $Filter | Select-Object Name, PrimarySmtpAddress,RecipientType | Export-CSV C:\PS\Export_Office365_GAL.csv -NoTypeInformationĪll possible types of recipients in Exchange Online have been exported to the CSV file: UserMailbox, MailUser, MailUniversalDistributionGroup, MailContact, DynamicDistributionGroup. Now you can get a list of all SMTP addresses from the Exchange Online tenant and export them to a CSV file: The following filter is used to add objects to the GAL: ((Alias -ne $null) -and (((ObjectClass -eq 'user') -or (ObjectClass -eq 'contact') -or (ObjectClass -eq 'msExchSystemMailbox') -or (ObjectClass -eq 'msExchDynamicDistributionList') -or (ObjectClass -eq 'group') -or (ObjectClass -eq 'publicFolder')))) $Filter = (Get-GlobalAddressList 'Default Global Address List').RecipientFilter Let’s get the filter of the Global Address List:
This address list includes all mail-enabled objects in the organization (users, groups, distribution groups). In our example, only the ‘Default Global Address List’ exists. Get-GlobalAddressList | Select-Object Name List the available Global Address Lists using the command: Connect to your Exchange Online tenant with EXO v2 module: It is much easier and more convenient to export the Global Address List from your Exchange Online (Microsoft 365) tenant using PowerShell.
Similarly, you can export a list of contacts, distribution lists, mail-enabled groups. To do this, go, for example, to Recipient -> Mailboxes, and select Export. However, you can export a list of user mailboxes, distribution groups, or resource mailboxes to a CSV file one by one. There are no built-in tools to export all GAL content in the Exchange Online web interface ( ). Get-ADUser -Filter * -SearchBase 'OU=London,OU=UK,DC=woshub,DC=com' -Properties proxyaddresses | Select-Object Name, Proxyaddresses| Export-CSV C:\PS\AD_OU_Export_GAL.csvĮxporting Global Address List from Exchange Online (Microsoft 365) Let’s export a list of users with SMTP addresses (proxyaddresses AD attribute) from a specific OU: Now this new group can be used just like any contact.You can use the PowerShell cmdlets Get-ADUser and Get-ADGroup from the AD PowerShell module to get a list of users and groups with SMTP addresses. Make sure to check “Also add these imported contacts to:” this just created group.