Modify a 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.
Computer
Example(s)
strContainer = "" strName = "EzAdComputer" 'This page contains only single-valued attributes 'so only the ADS_PROPERTY_CLEAR constant is defined here. Const ADS_PROPERTY_CLEAR = 1 '*********************************************** '* Connect to an object * '*********************************************** Set objRootDSE = GetObject("LDAP://rootDSE") If strContainer = "" Then Set objItem = GetObject("LDAP://" & _ objRootDSE.Get("defaultNamingContext")) Else Set objItem = GetObject("LDAP://cn=" & strName & "," & strContainer & "," & _ objRootDSE.Get("defaultNamingContext")) End If '*********************************************** '* End connect to an object * '*********************************************** WScript.Echo VbCrLf & "** General Properties Page**" WScript.Echo "** (Writing Single-Valued Attributes) **" objItem.Put "description", "VALUE" objItem.SetInfo WScript.Echo VbCrLf & "** Location Properties Page**" WScript.Echo "** (Writing Single-Valued Attributes) **" objItem.Put "location", "VALUE" objItem.SetInfo WScript.Echo VbCrLf & "**Non-standard value on Managed By Properties Page**" 'See Script Notes for information on setting this value. objItem.Put "managedBy", "DISTINGUISHED NAME VALUE" objItem.SetInfo objItem.SetInfo