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

Topic Last Modified: 2009-02-27

The Exchange Management Shell has a rich set of operators that enables comparisons of one object with another object or one object with a set of objects. For more information about comparison operators, run the following command in the Shell:

Copy Code
Get-Help About_Comparison_Operators

The following table lists the comparison operators that are available in the Shell. Some comparison operators are case-sensitive. If a comparison operator is case-sensitive, the case that is used in the strings that are being compared must match. For example, the string "Test" does not match "test" when you use a comparison operator that is case-sensitive.

Comparison operators that are available in the Exchange Management Shell

Operator Definition

-eq

Equals (not case-sensitive)

-ieq

Equals (not case-sensitive)

-ceq

Equals (case-sensitive)

-ne

Not equal (not case-sensitive)

-ine

Not equal (not case-sensitive)

-cne

Not equal (case-sensitive)

-lt

Less than (not case-sensitive)

-ilt

Less than (not case-sensitive)

-clt

Less than (case-sensitive)

-gt

Greater than (not case-sensitive)

-igt

Greater than (not case-sensitive)

-cgt

Greater than (case-sensitive)

-le

Less than or equal to (not case-sensitive)

-ile

Less than or equal to (not case-sensitive)

-cle

Less than or equal to (case-sensitive)

-ge

Greater than or equal to (not case-sensitive)

-ige

Greater than or equal to (not case-sensitive)

-cge

Greater than or equal to (case-sensitive)

-contains

The elements in the left operand that is equal to the right operand (not case-sensitive)

-icontains

The elements in the left operand that is equal to the right operand (not case-sensitive)

-ccontains

The elements in the left operand that is equal to the right operand (case-sensitive)

-notcontains

The elements in the left operand that is equal to the right operand (not case-sensitive)

-inotcontains

The elements in the left operand that is equal to the right operand (not case-sensitive)

-cnotcontains

The elements in the left operand that is equal to the right operand (case-sensitive)

-band

Bitwise And

-bor

Bitwise Or

-bnot

Bitwise NOT

-and

Logical and

-or

Logical or

-not

Logical not

-match

Compare strings by using regular expressions (not case-sensitive)

-notmatch

Compare strings by using regular expressions (not case-sensitive)

-imatch

Compare strings by using regular expressions (not case-sensitive)

-inotmatch

Compare strings by using regular expressions (not case-sensitive)

-cmatch

Compare strings by using regular expressions (case-sensitive)

-cnotmatch

Compare strings by using regular expressions (case-sensitive)

-like

Compare strings by using wildcard rules

-notlike

Compare strings by using wildcard rules

-ilike

Compare strings by using wildcard rules (not case-sensitive)

-inotlike

Compare strings by using wildcard rules (not case-sensitive)

-clike

Compare strings by using wildcard rules (case-sensitive)

-cnotlike

Compare strings by using wildcard rules (case-sensitive)

For More Information