''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 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.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' For computers running ISA Server 2004 Enterprise Edition, this script
' disables lockdown of the Firewall service due to logging failures and allows
' traffic to continue flowing when logging fails by preventing connections from
' being dropped in all arrays of the enterprise.
' For a computer running ISA Server 2004 Standard Edition, this script disables
' lockdown of the Firewall service due to logging failures.
' The script can be run on an ISA Server computer with the Firewall service
' installed, a remote management computer, or a Configuration Storage server
' (Enterprise Edition). If the script needs to connect to an ISA Server
' computer with the Firewall service installed or to a Configuration Storage
' server, it prompts the user for the name of the applicable computer and uses
' the credentials of the user who is logged on to connect to it. To run this
' script for an ISA Server 2004 Standard Edition computer or a single array of
' one or more ISA Server 2004 Enterprise Edition computers, the user must be an
' ISA Server Administrator. To run this script for multiple arrays, the user
' must be an ISA Server Enterprise Administrator.
' We recommend that you back up your configuration before running this script.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
' Define the constants needed.
Const Error_NotConnectedToCSS = &HC00403A6
Const Error_ConfigurationStorageServer = &HC00403A0
Const fpcTypeEnterpriseEdition = 1
Const fpcAlertActionStopServices = 3
Const alertName = "Log failure"
DisableLockdownOnLogFailure
Sub DisableLockdownOnLogFailure()
' Declare the objects needed.
Dim root ' The FPCLib.FPC root object
Dim isaArrays ' An FPCArrays collection
Dim isaArray ' An FPCArray object
Dim alert ' An FPCAlert object
Dim logs ' An FPCLogs collection
Dim log ' An FPCLog object
Dim serverName ' A String
Dim num ' An Integer
' Create the root object.
Set root = CreateObject("FPC.Root")
' Try to get the number of arrays.
On Error Resume Next
num = root.Arrays.Count
If Err.Number = Error_NotConnectedToCSS Then
serverName = _
InputBox("Enter the name of a Configuration Storage server.")
' Connect to the specified Configuration Storage server.
Err.Clear
root.ConnectToConfigurationStorageServer serverName
CheckError
ElseIf num = 0 Then
serverName = ""
Set isaArray = root.Arrays.Connect(serverName)
If Err.Number = Error_ConfigurationStorageServer Then
WScript.Echo "No arrays are configured in the enterprise."
WScript.Quit
End If
Err.Clear
' Get the name of an ISA Server computer with the Firewall service
' installed.
serverName _
= InputBox("Enter the name of an ISA Server computer.")
Err.Clear
Set isaArray = root.Arrays.Connect(serverName)
If Err.Number <> 0 Then
WScript.Echo "The specified computer is not available " _
& "or does not have the Firewall service installed."
WScript.Quit
End If
End If
' Get a reference to the arrays collection.
Err.Clear
Set isaArrays = root.Arrays
CheckError
For Each isaArray In isaArrays
' Get a reference to the "Log failure" alert object,
' and modify it so that it will not stop the Firewall service.
Set alert = isaArray.Alerts(alertName)
If Err.Number = 0 Then
alert.Actions.Unset fpcAlertActionStopServices
CheckError
alert.Actions.Save
CheckError
Else
WScript.Echo "The " & alertName & " alert was not found in " _
& isaArray.Name & "."
Err.Clear
End If
If isaArray.Type = fpcTypeEnterpriseEdition Then
' Get a reference to the FPCLogs collection
Set logs = isaArray.Logging
For Each log In logs
' Ensure that the DropConnectionOnLogError property
' is set to False.
log.DropConnectionOnLogError = False
Next
logs.Save
CheckError
End If
Next
WScript.Echo "Done!"
End Sub
Sub CheckError()
If Err.Number <> 0 Then
WScript.Echo "An error occurred: 0x" & Hex(Err.Number) & vbCrLf _
& Err.Description
Err.Clear
WScript.Quit
End If
End Sub