On Your Own: Lab 22 Creating OUs

In this lab, you are going to practice creating OUs. The result of this will eventually become a subroutine that you can employ in other scripts when you need OUs.

Lab Instructions

  1. Open Notepad.exe.

  2. On the first line, type Option Explicit.

  3. Declare the following variables: provider, domain, oClass, oOU, objDomain, objOU, oOUname, and oDescription.

  4. Assign the LDAP provider to the variable called provider. Your code will look like the following:

    provider = "LDAP://"
  5. Assign the variable domain to a domain that is accessible on the network, such as a.dom. Split each section of the domain name into domain components. This will look like the following:

    domain = "dc=a,dc=com"
  6. Assign the variable to the organizationalUnit class. ...

Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.