Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> OS >> Windows >> API >> ADSI >> ADO >> How to use ADO to query Active Directory

Dim con As New Connection, rs As New Recordset Dim Com As New Command 'Open a Connection object con.Provider = "ADsDSOObject" con.Open "Active Directory Provider" 'Create a command object on this connection Set Com.ActiveConnection = con Com.CommandText = "select name from 'LDAP://DC=ArcadiayBay,DC=COM' where objectClass='*' ORDER BY NAME" '----------------------------------------- 'Set the preferences for Search '-------------------------------------- Com.Properties("Page Size") = 1000 Com.Properties("Timeout") = 30 'seconds Com.Properties("searchscope") = ADS_SCOPE_SUBTREE '-------------------------------------------- 'Execute the query '-------------------------------------------- Set rs = Com.Execute '-------------------------------------- ' Navigate the record set '---------------------------------------- While Not rs.EOF Debug.Print rs.Fields("Name").Value rs.MoveNext Wend
[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]