Microsoft Internet Security and Acceleration Server 2004 SDK |
This VBScript example creates a new FPCConnectivityVerifier object in the FPCConnectivityVerifiers collection of the ISA Server computer. The script includes a single function, called AddConnectivityVerifier.
This example is included as the AddConnectivityVerifier.vbs script in the Sdk\Samples\Admin folder on the ISA Server 2004 CD.
The following procedure lists the steps used to create a new connectivity verifier in the code example that follows.
To create a connectivity verifier
The following code can be saved to a .vbs file and run from a command prompt on a computer running ISA Server 2004.
Sub AddConnectivityVerifier() ' Define enumeration values. const fpcGroupDNS = 2 const fpcPingRequest = 1 const serverAddress = "10.0.0.20" const thresholdTime = 2000 ' 2 seconds ' Create the root object. Dim root ' The FPCLib.FPC root object Set root = CreateObject("FPC.Root") 'Declare the other objects needed. Dim array ' An FPCArray object Dim verifiers ' An FPCConnectivityVerifiers collection Dim verifier ' An FPCConnectivityVerifier object ' Get references to the array object and the connectivity verifiers collection. Set array = root.GetContainingArray Set verifiers = array.ConnectivityVerifiers ' If a connectivity verifier named DNS Verifier already exists, remove it. verifiers.Refresh On Error Resume Next Set verifier = verifiers.Item("DNS Verifier") If Err.Number = 0 Then WScript.Echo "DNS Verifier exists. Removing it ..." verifiers.Remove "DNS Verifier" verifiers.Save End If WScript.Echo "Creating a new connectivity verifier ..." Set verifier = verifiers.Add("DNS Verifier") ' Set the description of the new connectivity verifier. verifier.Description = "This connectivity verifier checks connectivity by pinging the DNS server." ' Set the type of servers with which connectivity is checked. verifier.GroupType = fpcGroupDNS ' Set the server address and request type for connectivity verification requests. verifier.SetConnectivityRequest serverAddress, fpcPingRequest ' Set the round-trip time threshold for verification operations verifier.Threshold = thresholdTime 'Save the changes to the connectivity verifier. verifiers.Save WScript.Echo "Done!" End Sub AddConnectivityVerifier