Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » Adsi » VBScript » Delete a Contact object - vbscript sample

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


Contact

Example(s)

strContainer = ""
strName = "EzAdContact"

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

objContainer.Delete "contact", "cn=" & strName