用法:
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
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
=================================================================================
, ,自由广告区 |
分类导航 |
邮件新闻资讯: IT业界 | 邮件服务器 | 邮件趣闻 | 移动电邮 电子邮箱 | 反垃圾邮件|邮件客户端|网络安全 行业数据 | 邮件人物 | 网站公告 | 行业法规 网络技术: 邮件原理 | 网络协议 | 网络管理 | 传输介质 线路接入 | 路由接口 | 邮件存储 | 华为3Com CISCO技术 | 网络与服务器硬件 操作系统: Windows 9X | Linux&Uinx | Windows NT Windows Vista | FreeBSD | 其它操作系统 邮件服务器: 程序与开发 | Exchange | Qmail | Postfix Sendmail | MDaemon | Domino | Foxmail KerioMail | JavaMail | Winwebmail |James Merak&VisNetic | CMailServer | WinMail 金笛邮件系统 | 其它 | 反垃圾邮件: 综述| 客户端反垃圾邮件|服务器端反垃圾邮件 邮件客户端软件: Outlook | Foxmail | DreamMail| KooMail The bat | 雷鸟 | Eudora |Becky! |Pegasus IncrediMail |其它 电子邮箱: 个人邮箱 | 企业邮箱 |Gmail 移动电子邮件:服务器 | 客户端 | 技术前沿 邮件网络安全: 软件漏洞 | 安全知识 | 病毒公告 |防火墙 攻防技术 | 病毒查杀| ISA | 数字签名 邮件营销: Email营销 | 网络营销 | 营销技巧 |营销案例 邮件人才:招聘 | 职场 | 培训 | 指南 | 职场 解决方案: 邮件系统|反垃圾邮件 |安全 |移动电邮 |招标 产品评测: 邮件系统 |反垃圾邮件 |邮箱 |安全 |客户端 |