Hi
I am trying to write a query that will select all users in the Organization bucket in active directory. The problem is that within the Organization bucket, there are many other buckets. I want to filter/exclude one bucket.
Example:
+Organization
++Store1
+++User1
+++User2
++Store2
+++Users...
++Store3
+++Users...
I want to select all the Stores, except for Store3
Here is the query I have so far:
The query selects all active users in Organization
SELECT * FROM OPENQUERY(ADSI,
'<LDAP://OU=Organization,DC=sara-tx,DC=org>;(&(objectCategory=Person)(objectClass=U ser)(!userAccountControl:1.2.840.113556.1.4.803:=2 ));cn,givenName,sn,userAccountControl,telephoneNum ber,mail,department,title,physicalDeliveryOfficeNa me,company;subtree')
order by sn
Please help