Skip Ribbon Commands
Skip to main content

Xadean's Empirical Musing

:

Quick Launch

Xadean's Empirical Musing > Posts > Powershell – Advanced Filter
August 09
Powershell – Advanced Filter

Referenced links: http://blogs.msdn.com/b/adpowershell/archive/2009/04/14/active-directory-powershell-advanced-filter-part-ii.aspx

If you ever wanted to know what operators are available to be used in advanced filter powershell queries, here is how you can find out.

 

Step One: Launch Powershell

Step Two: Enter the following command in order to load the AD module.

    Command: import-module activedirectory

Step Three: Enter the following command to show help on the advanced filters.

    Command: get-help about_ActiveDirectory_Filter.

 

Here is a table of supported operators in Powershell Advanced Filter: 

Logical Operator

Description

Equivalent LDAP operator/expression

-eq

Equal to. This will not support wild card search.

=

-ne

Not equal to. This will not support wild card search.

! x = y

-like

Similar to -eq and supports wildcard comparison. The only wildcard character supported is: *

=

-notlike

Not like. Supports wild card comparison.

! x = y

-approx

Approximately equal to

~=

-le

Lexicographically less than or equal to

<=

-lt

Lexicographically less than

! x >= y

-ge

Lexicographically greater than or equal to

>=

-gt

Lexicographically greater than

! x <= y

-and

AND

&

-or

OR

|

-not

NOT

!

-bor

Bitwise OR

:1.2.840.113556.1.4.804:=

-band

Bitwise AND

:1.2.840.113556.1.4.803:=

-recursivematch

Uses LDAP_MATCHING_RULE_IN_CHAIN (Win2k3 SP2 and above)

:1.2.840.113556.1.4.1941:=

  

Comments

There are no comments for this post.

Add Comment

Title


Body *


CAPTCHA *

 

Attachments