Setting the Refresh Rate for Connectivity Verifiers

In Microsoft ISA Server 2004, connectivity verifiers can be defined for checking the connectivity from an ISA Server computer to a specific server on any network. Each connectivity verifier tests connectivity by sending requests of one of the following three types to the monitored server:

  • HTTP requests. When a connectivity verifier is configured to send requests of this type, ISA Server sends an HTTP GET request and waits for a reply. Receipt of the expected reply indicates that the Web server is running and can be reached by the ISA Server computer.
  • Ping requests. When a connectivity verifier is configured to send requests of this type, ISA Server sends an ICMP ECHO_REQUEST to the specified server and waits for an ICMP ECHO_REPLY. Receipt of the expected reply indicates that the server is running and can be reached by the ISA Server computer.
  • TCP connection requests. When a connectivity verifier is configured to send requests of this type, ISA Server tries to establish a TCP connection to a specific port on the specified server. Receipt of the expected reply indicates that a specific service is running on the server and can be reached by the ISA Server computer.

Each connectivity verifier is assigned to a group of connectivity verifiers of a specific type in ISA Server Management. The following group types are available: Active Directory, DHCP, DNS, Published Servers, Web (Internet), and Others.

By default, connectivity verifiers that are enabled test connectivity every 30 seconds. This time can be changed to any value in the range from 15 through 1,440 seconds by setting the RefreshRate property of the FPCConnectivityVerifiers collection. The value of this property applies to all ISA Server computers in an array.

The Microsoft Visual Basic Scripting Edition (VBScript) code in SetConnectivityRefreshRate.vbs (listed later in this Web page) sets the time, in seconds, that connectivity verifiers wait before rechecking connectivity by setting the RefreshRate property of the FPCConnectivityVerifiers collection for the containing array to the value specified by the user. This script must be run on an ISA Server computer with the Microsoft Firewall service installed, but it can be modified to run on a remote management computer. Note that this property can only be changed programmatically and cannot be accessed through ISA Server Management.

Usage:[CScript] SetConnectivityRefreshRate.vbs RefreshTime

RefreshTime specifies the value to which the RefreshRate property is to be set.

To set the refresh rate for connectivity verifiers

  1. Declare an FPC COM object, an FPCArray object, and an FPCConnectivityVerifiers collection.

  2. Create an instance of the FPC COM object, which is known as the root object and provides access to the other ISA Server administration COM objects.

  3. Get references to the FPCArray object and the FPCConnectivityVerifiers collection.

  4. Retrieve the current value of the RefreshRate property.

  5. If the current value of the RefreshRate property is not equal to the new value requested by the user, change the value of this property to the new value, and call the Save method on the connectivity verifiers collection to write the new value to persistent storage.

Script Listing: SetConnectivityRefreshRate.vbs

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Copyright (c) Microsoft Corporation. All rights reserved.

' THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE

' RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE

' USER. USE AND REDISTRIBUTION OF THIS CODE, WITH OR WITHOUT MODIFICATION, IS

' HEREBY PERMITTED.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' This script sets the time, in seconds, that connectivity verifiers wait

' before rechecking connectivity by setting the RefreshRate property of the

' FPCConnectivityVerifiers collection to the value specified by the user. The

' value of this property is initially set to 30 seconds, and its range of

' permissible values is from 15 through 1440.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Option Explicit

Main(WScript.Arguments)

Sub Main(args)

Dim newValue ' An Integer

If(args.Count <> 1) Then

Usage()

End If

On Error Resume Next

newValue = CInt(args(0))

If Err.Number <> 0 Then

WScript.Echo "The argument entered must be a number."

Else

On Error GoTo 0

If newValue >= 15 And newValue <= 1440 Then

SetConnectivityRefreshRate newValue

Else

WScript.Echo "The value specified must be between 15 and 1440."

End If

End If

End Sub

Sub SetConnectivityRefreshRate(newValue)

'Declare the objects needed.

Dim root ' The FPCLib.FPC root object

Dim isaArray ' An FPCArray object

Dim verifiers ' An FPCConnectivityVerifiers collection

' Create the root object.

Set root = CreateObject("FPC.Root")

' Get references to the array object

' and the connectivity verifiers collection.

Set isaArray = root.GetContainingArray()

Set verifiers = isaArray.ConnectivityVerifiers

' Change the value of the property if necessary.

WScript.Echo "Current refresh time: " & verifiers.RefreshRate

If newValue <> verifiers.RefreshRate Then

WScript.Echo "Setting the refresh time to " & newValue & "..."

verifiers.RefreshRate = newValue

verifiers.Save

WScript.Echo "Done!"

End If

End Sub

Sub Usage()

WScript.Echo "Usage:" & VbCrLf _

& " " & WScript.ScriptName & " RefreshTime" & VbCrLf _

& "" & VbCrLf _

& " RefreshTime - Connectivity refresh time to be set"

WScript.Quit

End Sub