LDAP query help request.



Hello all,

I'm trying to create some LDAP queries and seem to be running into a syntax
problem.

(&(objectCategory=user)(|(department=*60)(department=*61))(&(|(department=0042*)(department=0043*))))

The above statement works however I'm trying to add one more filter to the
statement and nothing I do seems to work. The idea is as follows...

(employeeid=1111) or (((Department=*60) or (Department=*61)) and
((Department=0042*) or (Department=0043*)))

This would return all the results for the 4 department number combinations
plus the 1 user with the employee id or 1111.




I thought that this statement would work... (as well as many many many
different syntax changes and I think this is the last one I tried before
hitting the newsgroups.)

(&(objectCategory=user)(|(employeeid=1111))(|(department=*60)(department=*61))(&(|(department=0042*)(department=0043*)))(!userAccountControl:1.2.840.113556.1.4.803:=2))

But it return no results, just one user, every user in AD or is invalid
depending on the syntax change. I could do this is SQL but for some reason
I just can't seem to get the syntax correct in LDAP.

Anyone of there see what it is I'm doing wrong or could lead me to better
LDAP syntax example pages then the one I have found?

Thanks.
David Gibbons


.



Relevant Pages

  • Re: How do I filter an Active Directory search to an OU (organizational unit)?
    ... > DirectoryEntry entry = new DirectoryEntry ... I think the easiest thing to do here would be to refine your LDAP string. ... (LDAP syntax is confusing because several different looking syntaxes are ... Although you might find you don't need your filter anymore. ...
    (microsoft.public.dotnet.security)
  • Re: ADAMsync Object Class Violation
    ... LDAP queries are fine, but I have to use XML ... on the AD account that doesn't exist in ADAM. ... complained about syntax. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Entourage with Directory services using Microsoft ADAM
    ... to list users. ... LDAP client that objects should or should not be returned. ... able to return results with Entourage by using our Domain ... LDAP syntax is LDAP syntax regardless of what computer platform you're using. ...
    (microsoft.public.mac.office.entourage)
  • Re: ldap and autofs
    ... I ran into a similar issue with SLES9 and ldap automount maps, ... The syntax you used above was in Netscape ... Netscape and NIS formats not the latest schema. ...
    (linux.redhat)
  • Re: [PHP] pack it in
    ... I got stuck playing with pack/unpack. ... by a particular syntax oid, and the syntax is written in backus noir form. ... for the password field, you have to supply ldap an appropriate ...
    (php.general)