WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

LDAP Query Syntax


Question:

Please explain the following LDAP query syntax:
; Disabled accounts have the second bit (2) of the
; userAccountControl property set.
sFilter = "(&(objectCategory=person)(objectClass=person)(userAccountControl:1.2.840.113556.1.4.803:=2))"
Could anyone tell me how this works? I've never seen this nomenclature before in AD. Can anyone point me to a reference that explains the colons and dot-separated numbers refer to?

Answer:

LDAP search filters are based on standards published by the IESG. The formal specification can be found here: http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2254.html

A more easily comprehended explanation can be found here: http://msdn.microsoft.com/en-us/library/aa746475(v=vs.85).aspx

The ADSI extender help file also contains a section on search filters.

User Reply:

I've been doing ADSI with WB for years and never new about the LDAP_MATCHING_RULE_BIT_AND type operation for query filters. I can't tell you how much this would have simplified some of the code I've written. Thanks for the link.
Article ID:   W16805
File Created: 2014:03:24:14:04:50
Last Updated: 2014:03:24:14:04:50