使用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.
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 = TRUEModify 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 = TRUEOpen 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 = TRUERestore 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/
?
?
