I am trying to query nearly all users in Active Directory. My normal users are in various OUs, and I want to retrieve those. But my system users are stored in the Users CN, and I don't want to retrieve those.
It looks a lot like another question, but their answer didn't help me. I'm using the hint provided here, but its not helping out either.
I am querying in Active Directory using JNDI. My query is:
(&(objectClass=user)(!(cn:dn:=Users)))
This means all objects of class user
, which are not in the Users
subtree. Yet, this query nevertheless returns something like this:
CN=__vmware__,CN=Users,DC=SIREDRM,DC=com
So, why is that filter not working? How else can I make it work?