Allow Windows Firewall exceptions (VBScript)

This code can be found in Chapter 3 of Windows Server 2003 Networking Recipes

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the VBScript code from this site.

' From the book "Windows Server 2003 Networking Recipes"

' This code allows exceptions to pass through the Windows Firewall
' for the current profile (Use LocalPolicy.DomainProfile or
' LocalPolicy.StandardProfile to alter a specific profile.)
' ------ SCRIPT CONFIGURATION ------
boolNoExceptions = FALSE ' Set to TRUE to prevent exceptions from passing
' ------ END CONFIGURATION ---------

Set firewall = CreateObject("HNetCfg.FwMgr")
Set firewallPolicy = firewall.LocalPolicy.CurrentProfile
firewallPolicy.ExceptionsNotAllowed = boolNoExceptions
WScript.Echo("ExceptionsNotAllowed set to " & boolNoExceptions & "!")

This code has been viewed 1928 times.

New from the creators of TechTasks.com: StatSheet.com