Skip to Content
Microsoft® Windows® Scripting Self-Paced Learning Guide
book

Microsoft® Windows® Scripting Self-Paced Learning Guide

by Ed Wilson
April 2004
Beginner
416 pages
11h 3m
English
Microsoft Press
Content preview from Microsoft® Windows® Scripting Self-Paced Learning Guide

On Your Own: Lab 26 Creating an ADO Query into Active Directory

In this lab, you will practice creating an ADO query into Active Directory to pull out information about computer objects.

Lab Instructions

  1. Open Notepad.exe.

  2. Type Option Explicit on the first line to force the declaration of all variables.

  3. Declare the following variables by using the Dim command: qQuery, objConnection, objCommand, and objRecordSet.

  4. 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 = ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® Windows® 2000 Scripting Guide

Microsoft® Windows® 2000 Scripting Guide

Microsoft Corporation
Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner

Publisher Resources

ISBN: 9780735619814Supplemental ContentCatalog PageErrata