应用VBS 操作防护墙

使用VBS 操作防护墙vbs 脚本是在windos OS上 run 的一种脚本语言,类似于linux上的shell?我们的product 使

使用VBS 操作防护墙

vbs 脚本是在windos OS上 run 的一种脚本语言,类似于linux上的shell

?

我们的product 使用vbs脚本来给virtual machine 设置hostname ,ip,netmask ,ect..

?

下面主要谈下 vbs操作防火墙:

?

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.


Add an Authorized Application


Adds Freecell.exe to the list of authorized applications in the current Windows Firewall profile.

List Authorized Applications in the Standard Profile


Lists all authorized applications for the Windows Firewall standard profile.

List All Globally-Open Ports


Lists all globally-open ports for the Windows Firewall current profile.

List Firewall Properties


Lists Windows Firewall properties for the current profile.

List Firewall Service Properties


Lists service properties for the Windows Firewall current profile.

List ICMP Settings


Lists ICMP settings for the Windows Firewall current profile.

List Remote Administration Settings


Lists remote administration settings for the Windows Firewall current profile.

List Standard Profile Properties


Demonstration script that connects to and returns information about the Windows Firewall standard profile.

Modify an ICMP Setting


Demonstration script that modifies a Windows Firewall ICMP setting for the current profile.

Set objFirewall = CreateObject("HNetCfg.FwMgr")Set objPolicy = objFirewall.LocalPolicy.CurrentProfileSet objICMPSettings = objPolicy.ICMPSettingsobjICMPSettings.AllowRedirect = TRUE

Modify a Firewall Property


Demonstration script that modifies Windows Firewall properties for the current profile.

Set objFirewall = CreateObject("HNetCfg.FwMgr")Set objPolicy = objFirewall.LocalPolicy.CurrentProfileobjPolicy.ExceptionsNotAllowed = TRUEobjPolicy.NotificationsDisabled = TRUEobjPolicy.UnicastResponsestoMulticastBroadcastDisabled = TRUE

Open a Closed Port


Opens closed port 9999 for the Windows Firewall current profile.

Set objFirewall = CreateObject("HNetCfg.FwMgr")Set objPolicy = objFirewall.LocalPolicy.CurrentProfileSet colPorts = objPolicy.GloballyOpenPortsSet objPort = colPorts.Item(9999,6)objPort.Enabled = TRUE

Restore the Default Settings


Restore the Windows Firewall default settings.

?

?

Set objFirewall = CreateObject("HNetCfg.FwMgr")objFirewall.RestoreDefaults()

?

转载:

http://www.activexperts.com/activmonitor/windowsmanagement/scripts/networking/windowsfirewall/

?

?