Contact Info

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

Create a new Computer 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 Computer ADSI class can be used in ActiveXperts Network Monitor to monitor your servers.



strContainer = ""
strName = "EzAdComputer"

'*         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 objComputer = objContainer.Create("computer", "cn=" & strName)