Home
»
Discussion Forums
»
Scripts & Agent Procedures
»
Script to disable Windows Firewall
Subscribe via RSS
Share this
Similar Posts
script to disable windows firewall
by
LegacyPoster
on
Mar 26, 2010
Windows XP SP3 Disable Firewall Script
by
LegacyPoster
on
Aug 28, 2009
Disabling Windows Firewall notifications
by
Rshaw
on
Nov 15, 2018
Verified Answer
Windows Firewall
by
LegacyPoster
on
Dec 7, 2009
Windows Firewall?
by
LegacyPoster
on
Sep 28, 2007
View More
Details
10
Replies
0
Subscribers
Posted
over 12 years ago
Scripts & Agent Procedures
Script to disable Windows Firewall
Posted by
LegacyPoster
on
Jul 9, 2008 10:41 PM
New to Kaseya and to Scripting and was wondering if anyone had a script to disable the Windows XP Firewall.
Thanks
Chris
Legacy Forum Name: Script to disable Windows Firewall,
Legacy Posted By Username: ModernTechIT
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 10, 2008 1:31 AM
This is a short script I wrote to disable the Windows Firewall and the Security Center service. It does require a reboot, you can add a force reboot at the end of the script if you like.
Script Name: Security Center & Windows Firewall - Disable
Script Description: ***REQUIRES REBOOT***
Turns off Windows Firewall and Disables Security Center service from starting via Registry.
Created by:
Charles Surrett @ CNWI
5/22/08
IF Service is Running
Parameter 1 : SharedAccess
THEN
Execute Shell Command
Parameter 1 : netsh firewall set opmode disable
Parameter 2 : 0
OS Type : 0
Set Registry Value
Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc\Start
Parameter 2 : 00000004
Parameter 3 : REG_DWORD
OS Type : 0
ELSE
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: cnwicsurrett
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 10, 2008 1:35 AM
You can also create an ELSE statement to log that Windows Firewall is already disabled.
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: cnwicsurrett
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 11, 2008 1:38 AM
This is a small script i use to turn it off immediately and then disable the service.
Script Name: AL-XP SP2 Firewall - OFF
Script Description: This script will immediately turn the Windows XP SP2 Firewall Off. (No reboot required)
IF True
THEN
Execute Shell Command
Parameter 1 : net stop sharedaccess
Parameter 2 : 1
OS Type : 8
Set Registry Value
Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Start
Parameter 2 : 4
Parameter 3 : REG_DWORD
OS Type : 8
ELSE
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: RatTrap
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 11, 2008 5:00 PM
It's good to have this script. Hw bout we reverce the process. Can we turn it on using script?
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: tesvin
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 13, 2008 7:26 PM
Nice work! Nice not having to reboot to enable/disable the firewall.
The script to enable the firewall is:
Script Name: Enable XPSP2 Firewall
Script Description: This script will immediately turn the Windows XP SP2 Firewall On. (No reboot required)
IF True
THEN
Set Registry Value
Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Start
Parameter 2 : 2
Parameter 3 : REG_DWORD
OS Type : 8
Execute Shell Command
Parameter 1 : net start sharedaccess
Parameter 2 : 1
OS Type : 8
ELSE
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: eddy@dgs.com.au
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 14, 2008 9:54 AM
Eddy,
To use your script works, i need to off the firewall using the same script with diff parameter like RatTrap showed b4. Your script won't work if i disable it manually. Why huh?
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: tesvin
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 24, 2008 2:24 AM
This is what i use....
Script Name: Disable Windows Firewall
Script Description: Disable Windows Firewall (netsh firewall set opmode disable)
IF True
THEN
Execute Shell Command
Parameter 1 : netsh firewall set opmode disable
Parameter 2 : 0
OS Type : 0
ELSE
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: Munnster
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 24, 2008 2:26 AM
To enable the firewall back...
Script Name: Enable Windows Firewall copy
Script Description: Enable Windows Firewall (netsh firewall set opmode enable)
IF True
THEN
Execute Shell Command
Parameter 1 : netsh firewall set opmode enable
Parameter 2 : 0
OS Type : 0
ELSE
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: Munnster
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 24, 2008 2:27 AM
This one enables file sharing through windows firewall...
Script Name: Windows Firewall - Enable File Sharing
Script Description: Enables file sharing exception in windows firewall
IF True
THEN
Execute Shell Command
Parameter 1 : netsh firewall set service type = FILEANDPRINT mode = ENABLE
Parameter 2 : 0
OS Type : 0
ELSE
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: Munnster
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jul 25, 2008 1:28 AM
@Munnster
These didn't work for me granted windows firewall is auto set to enabled via group policy and I haven't got the chance to try it on a non group polict machine as of yet
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: YLindsay
You have posted to a forum that requires a moderator to approve posts before they are publicly available.