首页业界动态通用技术技术文章-ISA技术文章-ISA 2006ForeFront TMG相关下载 登录论坛 @联系我们
ISA中文站 > 信息 > 相关下载 > ISA相关 > ISA脚本:创建策略规则报告
现在时间是: 2019-02-18 15:53
ISA脚本:创建策略规则报告

(2004-10-23 21:23)


创建策略规则报告



在 ISA Server 2004中,可以通过检索代表策略规则的对象的属性来创建包含策略规则信息的报告。PolicyRulesReport.vbs 中的 Microsoft Visual Basic Scripting Edition (VBScript) 代码可以检索系统策略规则集合和策略规则集合,循环访问这些集合,并生成一个报告。该报告中将包含规则名称,并将指示出各个规则是否已启用。可以修改此脚本以生成一些包含这些规则的其他属性的报告。



用法:


Cscript PolicyRulesReport.vbs(或双击执行)



创建一个策略规则报告
1.创建一个 FPC COM 对象实例,此实例提供对其他 ISA 服务器管理 COM 对象的访问。

2.声明一个 FPCArray 对象﹑两个 FPCPolicyRules 集合和一个 FPCPolicyRule 对象。

3.获取对现有的 FPCArray 对象﹑系统策略规则的 FPCPolicyRules 集合和普通策略规则的FPCPolicyRules 集合的引用。

4.在一个 For 循环中,循环访问系统策略规则集合中的对象。对每个系统策略规则,检索Enabled属性的值并显示规则的名称,名称后紧跟一个表明此规则被启用还是被禁用的指示符。

5.在一个 For 循环中,循环访问策略规则集合中的对象。对每个策略规则,检索 Enabled属性的值并显示规则的名称,名称后紧跟一个表明此规则被启用还是被禁用的指示符。

PolicyRulesReport.vbs的内容如下,复制到记事本中另存为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 retrieves the collection of system policy rules and the

' collection of policy rules and implicitly uses the _NewEnum property to

' iterate through the collections and display the names of the rules with

' an indication of whether each rule is enabled.

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

Sub IteratePolicyRules()

' Create the root obect.

Set root = CreateObject("FPC.Root")

' Declare the other objects needed.

Dim array ' An FPCArray object

Dim spRules ' An FPCPolicyRules 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

=================================================================================




作者:Microsoft Corp.
责任编辑:风间子

[1]
上一篇:补丁:在多处理器计算机上安装 ISA Server 2004 Standard Edition 时,将不启动 ISACTRL 和 WSPSRV 服务
下一篇:ISA脚本:删除缓存内容
相关信息:

ISA脚本:删除缓存内容

热点信息 TOP 10
[下载]ISA2004使用宝典正式发布! v1.02
[书籍下载]两个小时成为ISA Server 2004专家 v 1.03
ISA Server 2006 SP1 下载
ISA Server 工具下载 v6.0
ISA Server 2004工具下载 v5.0
[重要公告]ISA Server 2004 SP3正式发布!
[重要公告]ISA Server 2004 SP2正式发布!
ISA Server 2006 需要安装的补丁下载(即时更新)
ISA 2004配置DEMO下载
ISA Server 2004 VPN技术资料下载

搜索 SEARCH
关键字:
包含:
搜索于:


Copyright © ISACN.ORG 2004-2019 All Rights Reserved..