Contact Info

Crumbtrail » Administration » Scripts » Adsi » VBScript » Create a new OU object - vbscript sample

Create a new OU object - vbscript sample

Active Directory Services Interface (ADSI) is a set of COM (Common Object Model) programming Interfaces. Like ODBC, ADSI provides common access to directories by adding a provider for each directory protocol type.

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.

On this site, you can find many ADSI samples.

The Organizational Unit ADSI class can be used in ActiveXperts Network Monitor to monitor your servers.

Organizational Unit


strContainer = ""
strName = "EzAdOrganizationalUnit"

'*         Connect to a container              *
Set objRootDSE = GetObject("LDAP://rootDSE")
If strContainer = "" Then
  Set objContainer = GetObject("LDAP://" & _
  Set objContainer = GetObject("LDAP://" & strContainer & "," & _
End If
'*       End connect to a container            *

Set objOrganizationalunit = objContainer.Create("organizationalUnit", "ou=" & strName)