TxCellarRat
asked on
How can I write an ldap query to include all users from my active directory except those in a certain OU?
I'm having a debate with myself. I'm just starting to understand LDAP Queries and wanted to pose a couple of questions because I can't seem to find the right information anywhere.
I get I can write an LDAP query that starts at the root of my Active Directory and return all the users in my AD environment.
Now..what if I want to traverse my directory and say give me all users in my Active Directory environment EXCEPT for the users in OU=Test,DC=somecity,DC=com pany,DC=co m?
(&(objectCategory=user)(!( ou=test,dc =somecity, dc=company ,dc=com)))
isn't working. That returns all users regardless of their OU affiliation.
Am I using the & operator incorrectly? I also tried (what I thought was): give me all the users in the given OU...that didn't work either?
(&(objectCategory=user)(ou =test,dc=s omecity,dc =company,d c=com)))
Any suggestions or assistance will be greatly apprciated!
V
I get I can write an LDAP query that starts at the root of my Active Directory and return all the users in my AD environment.
Now..what if I want to traverse my directory and say give me all users in my Active Directory environment EXCEPT for the users in OU=Test,DC=somecity,DC=com
(&(objectCategory=user)(!(
isn't working. That returns all users regardless of their OU affiliation.
Am I using the & operator incorrectly? I also tried (what I thought was): give me all the users in the given OU...that didn't work either?
(&(objectCategory=user)(ou
Any suggestions or assistance will be greatly apprciated!
V
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://ldapwiki.willeke.com/wiki/ExtensibleMatch
It it painful from MS documentation to determine if they do or not.
http://msdn.microsoft.com/en-us/library/cc223241(v=prot.10).aspx
-jim