An address list is a collection of mail-enabled recipient objects in Exchange Online. Address lists are based on recipient filters. For more information about address lists, see Address lists in Exchange Online.
Looking for the Exchange Server version of this topic? See Create address lists.
What do you need to know before you begin?
Estimated time to complete each procedure: 5 minutes.
By default, the Address List role isn't assigned to any role groups in Exchange Online. To use any cmdlets that require the Address List role, you need to add the role to a role group. For more information, see Modify role groups.
You can only use Exchange Online PowerShell to perform virtually all of the procedures in this topic (everything except hiding recipients from address lists). To connect to Exchange Online PowerShell, see Connect to Exchange Online PowerShell.
This example creates an address list with a custom recipient filter:
Name: Northwest Executives
Location: Under the existing address list named North America.
Custom recipient filter: All users with mailboxes where the Title value contains Director or Manager, and the State or province value is WA, OR, or ID (Washington, Oregon, or Idaho).
For detailed syntax and parameter information, see New-AddressList.
This example creates the address list named Oregon and Washington Users by using the RecipientFilter parameter and includes recipients that are mailbox users and have StateOrProvince set to Washington or Oregon.
For detailed syntax and parameter information, see New-AddressList.
How do you know this worked?
To verify that you've successfully created an address list, replace <AddressListIdentity> with the path\name of the address list, and run the following command in Exchange Online Powershell to verify the property values:
Use Exchange Online Powershell to view members of address lists
Technically, this procedure returns all recipients (including hidden recipients) that match the recipient filters for the address list. The recipients that are actually visible in the address list have the HiddenFromAddressListsEnabled property value False.
To view the members of an address list, use the following syntax:
Use Exchange Online PowerShell to update address lists
The Update-AddressList cmdlet (or Update-GlobalAddressList) isn't available in Exchange Online PowerShell. If recipients that should appear an address list do not, you need to change the required property value for those users to a temporary value, and then back to the value that's required by the address list. You can update the user property values in the Exchange admin center (EAC) or Exchange Online PowerShell, but it's quicker to do bulk operations in PowerShell.
For example, suppose the address list named Oregon and Washington Users uses the filter "((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'Washington') -or (StateOrProvince -eq 'Oregon')))", but the address list doesn't include everyone whose StateOrProvince property values are set correctly. To update the address list, perform the following steps:
Use the query from the address list to find all users that should be in the address list. For example:
Change the temporary value back to the required value. For example, change the StateOrProvince values from OR to Oregon, and WA to Washington:
PowerShell
$After | where {$_.StateOrProvince -eq'OR'} | foreach {Set-User$_.Identity -StateOrProvince Oregon}
PowerShell
$After | where {$_.StateOrProvince -eq'WA'} | foreach {Set-User$_.Identity -StateOrProvince Washington}
Notes:
Title, department and address properties require the Get-User and Set-User cmdlets. CustomAttribute1 through CustomAttribute15 properties require the Get-Mailbox and Set-Mailbox cmdlets. For more information about what properties are available on which cmdlet, see the following topics:
If a only small number of users don't appear in the address list, you can modify the required property value for each user. For example:
Set a temporary property value for the user:
PowerShell
Set-User -Identity <UserIdentity> -StateOrProvince WA
Change the temporary value back to the required value:
PowerShell
Set-User -Identity <Identity> -StateOrProvince Washington
How do you know this worked?
To verify that you've successfully updated an address list, replace <AddressListIdentity> with the name of the address list, and run the following command in Exchange Online PowerShell to verify the RecipientFilterApplied property value:
When you modify the Conditional parameter values, you can use the following syntax to add or remove values without affecting other existing values: @{Add="<Value1>","<Value2>"...; Remove="<Value1>","<Value2>"...}.
This example modifies the existing address list named Southeast Offices by adding the State or province value TX (Texas) to the precanned recipient filter.
For detailed syntax and parameter information, see Set-AddressList.
How do you know this worked?
To verify that you've successfully modified an address list, replace <AddressListIdentity> with the path\name of the address list, and run the following command in Exchange Online Powershell to verify the property values:
To verify that you've successfully removed an address list, run the following command in Exchange Online Powershell to verify that the address list isn't listed:
PowerShell
Get-AddressList
Hide recipients from address lists
Hiding a recipient from address lists doesn't prevent the recipient from receiving email messages; it prevents users from finding the recipient in address lists. The recipient is hidden from all address lists and GALs (effectively, they're exceptions to the recipient filters in all address lists). If you want to selectively include the recipient in some address lists but not others, you need to adjust the recipient filters in the address lists to include or exclude the recipient.
Hiding a recipient from address lists can also prevent users from being found through an address book search. For example, (Auto Attendant service voice recognition) [/microsoftteams/dial-voice-reference] won't be able to find and redirect calls to this recipient.
Use the new EAC to hide recipients from address lists
This module provides instruction on how to create groups for distributing email to multiple users within Exchange Online. It also explains how to create groups to support collaboration in SharePoint Online.