Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


SQL Active Directory Query

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,39994
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> SQL Active Directory Query
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 SQL Active Directory Query - 11/22/2006 1:23:38 AM   
  dug04

 

Posts: 2
Score: 0
Joined: 11/8/2006
Status: offline
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
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> SQL Active Directory Query Page: [1]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts