'************************************************** ' ' This script adds an OU to the passed in NC ' To run: cscript addou_adam.vbs [NC] [OU Name] ' Examples: cscript addou_adam.vbs LDAP://localhost:389/O=Microsoft,c=us testou ' '************************************************** set Args = Wscript.Arguments NCName = Args(0) ouName = Args(1) ' If the application NC DN is "c=us" and the server is "adamhost" and the port is 389. ' Then the parameter NCName should be passed ' as follows: "LDAP://adamhost:389/c=us" 'Bind to Root Set nc = GetObject( NCName) Set ou = nc.Create("organizationalUnit", "ou=" & ouName) ou.Put "description", "ADAM test OU" ou.SetInfo wscript.echo " The Organizational Unit " & ouName & " was created successfully"