Exchange Management Console provides an easy way of filtering data. If you have thousands of users in your organization you can use filtering to find a particular user. Filtering can also be used to find other objects such as servers or e-mail messages. If you prefer to use the command line, then you can use Microsoft PowerShell to create filters. This document will focus on the Graphical User Interface, but the PowerShell equivalent cmdlet will be provided to illustrate how you can create the same filters through PowerShell.

Recipient Filtering

You can create a recipient filter by clicking on the "Create Filter" button as shown below (clickable thumbnails show full resolution screenshots):

The node selected in Exchange Management Console will impact the properties and the types of operators that are available to you. Also, depending on the properties and the type of comparison operator that you choose, the value may be a free form text box, a pre-populated drop-down box or a browse button used to select a specific value.

For example, if you click on the "Recipient Configuration" node and create a filter, the following properties will be available:

  1. ActiveSync Mailbox Policy
  2. Alias
  3. City
  4. Company
  5. All of the CustomAttributes
  6. Database
  7. Department
  8. Display Name
  9. E-Mail Addresses
  10. External E-mail Address
  11. First Name
  12. Last Name
  13. Managed By
  14. Managed Folder Mailbox Policy
  15. Name
  16. Office
  17. Recipient Type Details
  18. Server
  19. State or Province
  20. UM Enabled
  21. Unified Messaging Mailbox Policy
  22. User logon name (pre-Windows 2000)
  23. User logon name (User Principal Name)

Note that since we're filtering on "recipients" some of these properties apply to one recipient type and not others.
Available Comparison operators for the above properties are:

  1. Contains
  2. Does Not Contain
  3. Does Not Equal
  4. Ends With
  5. Equals
  6. Starts With

Note that which of these comparison operators are available for the filter expression depends on the property selected.

Free form text box example:

Browse button example:

Drop-down box example:

Once you have added and configured a filter you can apply the filter by simply clicking on the "Apply Filter" button. You can also add additional filter expressions by clicking on "Add Expression". You can add up to a maximum of 10 filter expressions; after the 10th filter expression, the "Add Expression" button will become disabled.

Removing filter expressions is also an easy operation; you can remove individual filter expressions by clicking on the "X" button located on the far right of the row or you can remove the whole filter by clicking on the "Remove Filter" button.

So, now that we know how to add/remove filters in Exchange Management Console, we can see how easy it is to find a user if you know, for example, his/her Alias:

Before applying the filter we can see many users:

After applying the filter we can see that only one user gets displayed:

Implicit "AND" and "OR" Operators

So, what happens when you add more than one filter expression? If you create more than one filter expression on the same property, these expressions are treated as an OR operation. In the case below we are looking for users with alias equals User100 OR equals User101, so we get two users back.

The command line equivalent would be the following:

[PS] D:\>get-mailbox -filter { (Alias -eq "user100") -or (Alias -eq "user101") }

Name Alias ServerName ProhibitSendQuota

---- ---- ------ ---------

User100 User100 4367r9-a25 unlimited

User101 User101 4367r9-a25 unlimited

If you create more than one filter expression using different properties, these expressions are treated as an AND operation. In the following example the filter returns no results because although a "User100" alias can be found, this User100 is not also "UM Enabled."

The command line equivalent would be the following:

[PS] D:\>get-mailbox -filter { (Alias -eq "user100") -and (UMEnabled -eq $true) }

[PS] D:\>

Client Side vs. Server Side Filtering

Server Side Filtering refers to filtering operations that are done on the server as opposed to the client. By performing operations on the server we reduce network traffic.

For example if you execute the following Powershell cmdlet:

[PS] D:\>get-mailbox -filter { Alias -eq "User165" }

Name Alias ServerName ProhibitSendQuota

-- --- ----- ---------

User165 User165 4367r9-a25 unlimited

Since we used the "-filter" parameter, the filtering is done on the server side and only one result is returned across the network to the client. (In case you're wondering, Exchange Management Console has been optimized to use Server Side Filtering on all recipient operations.)

Client Side Filtering refers to filtering operations that are done on the client as opposed to the server. The problem with these operations is that the entire initial result is returned to the client from the server and the filtering is then done at the client. This can result in increased network traffic and lowered performance in filtering. The equivalent client side Powershell cmdlet to the above operation would be:

[PS] D:\>get-mailbox | where { $_.Alias -eq "User165" }

Name Alias ServerName ProhibitSendQuota

-- --- ----- ---------

User165 User165 4367r9-a25 unlimited

Where possible, for recipient filtering operations it is recommended that you use Server side filtering by using the "-filter" parameter.

Server Filtering

Creating filters to find server specific data is as easy as creating recipient filters. You can create server filters by clicking on the Server Configuration node or one of its children nodes. Let's look at some examples of properties that are available when selecting different nodes:

Selecting the Server Configuration Node:

Selecting the Client Access Node:

Selecting the Unified Messaging Node:

As with Recipient Filtering, which property you select will control the type of operators and values that you can use. For example "ole equals" would yield the following values:

Let's look at a couple of examples:

Example 1:

The command line equivalent would be the following:

[PS] D:\>Get-ExchangeServer | where { $_.IsClientAccessServer -eq $true }

Name Site ServerRole Edition AdminDisplayVersion

-- -- ----- ---- ----------

4367R9-A26 FirstSite ClientAc... Enterprise Version 8.0 (Bui...

Example 2:

The command line equivalent would be the following:

[PS] D:\>Get-TransportServer | where { $_.MessageTrackinglogEnabled -eq $true }

Name MessageTrackingLogEnabled ExternalPostmasterAddress

-- ------------- -------------

4367R9-A26 True

- Mauricio Encina