April 2004
Beginner
416 pages
11h 3m
English
In this lab, you will practice creating an ADO query into Active Directory to pull out information about computer objects.
Open Notepad.exe.
Type Option Explicit on the first line to force the declaration of all variables.
Declare the following variables by using the Dim command: qQuery, objConnection, objCommand, and objRecordSet.
Create a query using the LDAP namespace that connects to your local Domain Controller. Specify the objectCatagory that is equal to computer. Choose the following fields: distinguishedName, name, and logonCount. Set the search dimension to subtree. Assign this query to a variable called qQuery. Your code will look like the following:
qQuery = ...