

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: 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.
