SQL Active Directory Query

Author Message
dug04

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 11/8/2006
  • Status: offline
SQL Active Directory Query Wednesday, November 22, 2006 2:23 AM (permalink)
0
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=User)(!userAccountControl:1.2.840.113556.1.4.803:=2));cn,givenName,sn,userAccountControl,telephoneNumber,mail,department,title,physicalDeliveryOfficeName,company;subtree')
order by sn
 
 
Please help
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9