Recipient Filtering and Server Filtering in Exchange Server 2007


Topic Last Modified: 2010-02-16

If you have thousands of users in your organization, it may be difficult to locate a particular user or e-mail message. Similarly, it may be difficult to find server specific data. To help locate these and other objects in Microsoft Exchange Server 2007, Exchange administrators can use the filtering feature in the Exchange Management Console. Filters can also be created by using the Exchange Management Shell.

The following list describes the Create Filter feature:

  • A filter contains one or more expressions. Each expression consists of an attribute, an operator, and a value. The attributes vary depending on the items for which you are creating the filter. For example, you can filter mailboxes based on attributes such as Alias and Display Name.

  • The list of operators that are available is based on the attribute that you select. For example, when you filter recipients, the Display Name attribute can have Starts With as an operator.

  • The list of acceptable values is also based on the attribute you select. Acceptable values are selected from a list, such as the Role attribute for servers. In addition, you can type the values for some attributes in the Value field, such as the Display Name attribute.

When you are building expressions for a filter, you can't specify what is an AND or an OR expression. However, the default behavior of the filter is as follows:

  • Multiple expressions that use the same attribute are considered an OR expression.

  • Expressions that use different attributes are considered an AND expression.

In this topic, we discuss how to use the Filtering feature in the Exchange Management Console, and provide the cmdlet that you can use in the Exchange Management Shell to create the same filter.

Client-Side Filtering refers to filtering operations that are completed on the client. Server-Side Filtering refers to filtering operations that are completed on the server. A problem that affects Client Side Filtering is that the entire initial result is returned to the client from the server, and then filtering is completed on the client. This can result in increased network traffic and lowered performance in filtering. By performing operations on the server, we reduce network traffic. Exchange Management Console has been optimized to use Server Side Filtering on all recipient operations. In the Exchange Management Shell, the -filter parameter is used so that filtering is done on the server side, and only one result is returned across the network to the client.

For example, consider the following cmdlet:

get-mailbox -filter { Alias -eq "User165" }

If you execute this cmdlet, you receive one result that contains the alias "User165".

The equivalent client-side PowerShell cmdlet is the following:

get-mailbox | where { $_.Alias -eq "User165" }

Whenever it is possible, we recommend that you use Server-Side Filtering by using the -filter parameter for recipient filtering operations when you use the Exchange Management Shell.

In the Exchange Management Console, use the Create Filter feature to locate specific objects that meet specific search criteria. The node selected in Exchange Management Console determines the properties and the types of operators that are available to you. Also, depending on the properties and the kind of comparison operator that you choose, the value may be a freeform text box, a pre-populated list box, or a browse button that lets you select a specific value.

For example, if you click the Recipient Configuration node, and then you create a filter, the following properties are available:

  • ActiveSync Mailbox Policy

  • Alias

  • City

  • Company

  • All of the CustomAttribute#s

  • Database

  • Department

  • Display Name

  • E-Mail Addresses

  • External E-mail Address

  • First Name

  • Last Name

  • Managed By

  • Managed Folder Mailbox Policy

  • Name

  • Office

  • Recipient Type Details

  • Server

  • State or Province

  • UM Enabled

  • Unified Messaging Mailbox Policy

  • User logon name (pre-Windows 2000)

  • User logon name (User Principal Name)

Not all these properties are always available. Which properties are available depends on the recipient type that is selected.

The following comparison operators are available for the properties in the previous list:

  • Contains

  • Does Not Contain

  • Does Not Equal

  • Ends With

  • Equals

  • Starts With

Not all these comparison operators are always available. Which comparison operators are available depends on the property that is selected.

After you add and configure a filter, click Apply Filter to apply the filter. If you want to add additional filter expressions, click Add Expression. You can add a maximum of 10 filter expressions; after the 10th filter expression, the Add Expression button is disabled.

To remove filter expressions, click Close button at the far right side of the row, or click Remove Filter to remove the whole filter.

To filter recipients in the results pane
  1. In the Exchange Management Console, click Mailbox in the Recipient Configuration node of the console tree.

  2. At the top of the results pane, click Create Filter to start defining your filter.

  3. Use the list boxes to create the first filter expression.

  4. To create a filter with more than one expression, click Add Expression. Additional expressions make the filter more restrictive, which allows you to focus more on the list of items. You can add up to 10 expressions. You can modify any expression as you create it. To remove any expression from your filter definition, click the red X.

  5. To view only the items that match the criteria defined by the expressions in the filter that you created, click Apply Filter.

  6. To remove all expressions and close the filter, click Remove Filter. The Results pane displays the full list of items in the Exchange organization.

  7. To save the filter as the default filter, click Save Current Filter as Default on the View menu.

To complete the same filtering action by using the Exchange Management Shell, you use the -filter parameter. The following table describes the action and the one-line command that can be used:


Description One-line command

Filter that uses the OR operator to return two results for the "Alias" attribute

get-mailbox -filter { (Alias -eq "Alias_1") -or (Alias -eq "Alias_2") }

Filter that uses the AND operator to return results for the "Alias" attribute and for the "UMEnabled" attribute

get-mailbox -filter { (Alias -eq "Alias") -and (UMEnabled -eq $true) }

To find server specific data, you create filters in the Server Configuration node or in one of its children nodes. Creating filters here is similar to creating filters in the Recipient Configuration node. The attributes that are available for the filter depend on the items for which you are creating the filter.

For example, if you click Server Configuration in the console tree, and then you click Create Filter in the results pane, you can filter for the following attributes:

  • Cluster

  • Edition

  • Name

  • Product ID

  • Role

  • Site

  • Version

If you select the Client Access node in the console tree, and then you click Create Filter in the results pane, you can filter for the following attributes:

  • Edition

  • Name

  • Outlook Anywhere Enabled

  • Product ID

  • Role

  • Site

  • Version

Similar to Recipient Filtering, the attribute that you select will determine the operators and values that you can use.

For example, if you filter Server Configuration, for the Role attribute, you can select the Equals operator and the Client Access value. This filter returns all servers that are assigned the Client Access role.

The same action can be completed by using the Exchange Management Shell. The following table contains examples that describe the action, and provide the one-line command to complete the action.


Description One-line command

In the Server Configuration node, find servers that are assigned the Client Access role

Get-ExchangeServer | where { $_.IsClientAccessServer -eq $true }

Locate servers that are assigned the Hub Transport role, and for which Message tracking is enabled

Get-TransportServer | where { $_.MessageTrackinglogEnabled -eq $true }