Applies to: Exchange Server 2010 SP3, Exchange Server 2010 SP2

Topic Last Modified: 2011-11-09

This topic explains how to use the Exchange Management Shell to create an address list by using recipient filters. To learn more about address lists, see Managing Address Lists.

To use the RecipientFilter parameter to create a custom filter, you must specify a string for the filter. The Shell uses OPATH for the filtering syntax. OPATH is a querying language designed to query object data sources. For more information about the OPATH filtering syntax, see Creating Filters in Recipient Commands.

Looking for other management tasks related to address lists? Check out Managing Address Lists.

Use the Shell to create an address list by using recipient filters

You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Recipient Provisioning Permissions" section in the Mailbox Permissions topic.

Note:
You can't use the EMC to create an address list by using recipient filters.

To create an address list by using the RecipientFilter parameter, use the following syntax.

Copy Code
New-AddressList -Name <String> -RecipientFilter <String>

This example creates an address list for all users with Exchange mailboxes who reside in Washington or Oregon.

Copy Code
New-AddressList -Name "Pacific Northwest Mailboxes" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'Washington') -or (StateOrProvince -eq 'Oregon')))}

This example creates an address list for all users with Exchange mailboxes who have AgencyB as the value for the CustomAttribute15 parameter.

Copy Code
New-AddressList -Name "AgencyB" -RecipientFilter {(RecipientType -eq 'UserMailbox') -and (CustomAttribute15 -like *AgencyB*)}

For detailed syntax and parameter information, see New-AddressList.