Monday, December 1, 2008

Creating an OU in an Existing OU

Creates a new organizational unit (OU2) in an existing organizational unit (OU1).

Set objOU1 = GetObject("LDAP://ou=OU1,dc=na,dc=fabrikam,dc=com")
Set objOU2 = objOU1.Create("organizationalUnit", "ou=OU2")
objOU2.SetInfo

This is a VB Script, this can be used by saving the file in .vbs file