You can use the Visual Basic script that is described in this section as a template to generate a detailed firewall policy report. You can modify this script to display any combination of details about some or all of the firewall policy rules that are contained in ISA Server 2004.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. This article assumes that you are familiar with the following topics:
- Visual Basic
- Internet Security and Acceleration Server 2004
To run the Visual Basic script:
- Copy the following Visual Basic script to a text editor (such as Notepad), and then save the file by using a .vbs file name extension to your local ISA Server computer:
Sub IteratePolicyRules()
' Create the root obect.
Set root = CreateObject("FPC.Root")
' Declare the other objects that you want.
Dim array ' An FPCArray object
Dim spRules ' An FPCSystemPolicyRules collection
Dim rules ' An FPCPolicyRules collection
Dim rule ' An FPCPolicyRule object
Dim isEnabled ' A string
' Get references to the array object, the system
' policy rules collection, and the policy rules collection.
Set array = root.GetContainingArray()
Set spRules = array.SystemPolicy.PolicyRules
Set rules = array.ArrayPolicy.PolicyRules
' List the system policy rules and indicate whether each
' rule is enabled.
WScript.Echo "***System Policy Rules***"
For Each rule In spRules
If rule.Enabled = True Then
isEnabled = "Enabled"
Else
isEnabled = "Disabled"
End If
WScript.Echo rule.Name & ": " & isEnabled
Next
' List the policy rules and indicate whether each
' rule is enabled.
WScript.Echo vbCrLf & "***Policy Rules***"
For Each rule In rules
If rule.Enabled = True Then
isEnabled = "Enabled"
Else
isEnabled = "Disabled"
End If
WScript.Echo rule.Name & ": " & isEnabled
Next
End Sub
IteratePolicyRules
- In your text editor, view the script that you made in step 1.
- Use the commented sections of the code as a guide to modify the code to include the report information that you want, and then save your changes.
- Click Start, click Run, type cmd, and then click OK.
- At the command prompt, change to the folder that contains the .vbs file that you saved in step 3.
- At the command prompt, type cscript YourISAReport.vbs, and then press ENTER. In this command, YourISAReport is the name of the file that you chose in step 1.
For more information about Internet Security and Acceleration Server 2004, visit the following Microsoft Web site.
For more information about Microsoft Visual Studio .NET, visit the following Microsoft Web site.