您好,在测试微软提供的ISA RQS Script Sample( RQScript.Vbs )时,我遇到一个问题。
脚本中先假设计算机上Windows防火墙已启用(allfw=ture),然后用InternetFirewallEnabled判断是否在具体网络连接上也启用了Windows防火墙?
#######################
Function Check_IsICFEnabled
'--------------------------
' Returns true if all non-VPN connections are firewalled
Const ProgID_NetConLib = "HNetCfg.HNetShare.1" 'hnetcfg.dll
Const NCM_Tunnel = 5 'Mediatype=VPN
Dim connmgr, connlist, conn, connProps, connConfig, allFw
allFw = true
set connmgr = CreateObject(ProgID_NetConLib)
set connlist = connmgr.EnumEveryConnection
for each conn in connlist
set connProps = connmgr.NetConnectionProps(conn)
set connConfig = connmgr.INetSharingConfigurationForINetConnection(conn)
if connProps.MediaType <> NCM_Tunnel then
allFw = allFw and connConfig.InternetFirewallEnabled
end if
next
Check_IsICFEnabled = allFw
End Function
########################################
我的问题是:如何判断计算机上Windows防火墙已启用?
另外,我是一个没有编程经验的脚本初学者。我在读到ProgID_NetConLib =
"HNetCfg.HNetShare.1"时,不知道该怎么查询HNetCfg.HNetShare.1的reference。我搜索到Primitive:
Hnetcfg.dll的页面,可是得不到需要的信息。我该怎么查询到后面的EnumEveryConnection,NetConnectionProps等方法?
Thanks in advance!