Welcome › Forums › General PowerShell Q&A › understanding the use of LDAPFilter
This topic contains 4 replies, has 3 voices, and was last updated by
I have this small line of code to find all Windows 10 machines:
Get-ADObject -LDAPFilter "(&(operatingSystem=Windows 10 *) (objectClass=computer))" -SearchBase "DC=theaa,DC=local" -SearchScope Subtree |
the line i'm interested in is
"(&(operatingSystem=Windows 10 *) (objectClass=computer))"
is the "(&(" and and ? so it allows the two filter requirements ? Not seen it written this way before.
In LDAP syntax the comparison operator goes at the start of the clause so, in your, example. The filter translates to "give me all the objects where the operatingSystem attribute is 'windows 10' AND the object is a computer object".
Lots of examples and how to use the syntax here: Active Directory LDAP Syntax Filters
Thank you Matt, very helpful. Good link as well.
For lots of examples and a explanation of LDAP filters in use see the appendix of Learn Active Directory Management in a Month of Lunches. http://www.manning.com
Thank you Richard.
The topic ‘understanding the use of LDAPFilter’ is closed to new replies.