AutomoxAutomox

Disable Windows Firewall

TJ_Coppola
November 16, 2021 at 4:04 pm UTC

Here’s a simple worklet for turning off the firewall on your windows PCs.

Evaluation:

powershell11 lines
$firewallStatusDomain = (Get-NetFirewallProfile -Profile Domain).enabled
$firewallStatusPublic = (Get-NetFirewallProfile -Profile Public).enabled
$firewallStatusPrivate = (Get-NetFirewallProfile -Profile Private).enabled
$fwCheck = 0

if ($firewallStatusDomain) {$fwCheck += 1}
if ($firewallStatusPublic) {$fwCheck += 1}
if ($firewallStatusPrivate) {$fwCheck += 1}

if ($fwcheck -gt 0) {exit 1}
else {exit 0}

Remediation:

Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack

Replies (5)

AnonymousNovember 16, 2021
#1

frysuseating

TJ_CoppolaNovember 16, 2021
#2

Not really sure what this means. Are you confused by something?

AnonymousNovember 16, 2021
#3

Lol nah, I’m just a paranoid former next-gen-firewall guy. 🙂 Which actually presents a pretty good reason for a worklet like this since most firewalls just don’t play nice with each other. I like it/welcome to the AX Community! Care to share the use-case that prompted this?

TJ_CoppolaNovember 16, 2021
#4

We have some legacy broadcast appliances that don’t like windows firewall so the computers that manage them have the firewall turned off.

They’re in a pretty isolated VLAN, and we put S1 on everything now, so it’s just not giving us a lot of value for the headache.

AnonymousNovember 16, 2021
#5

Ah-ha…yup, perfect use-case. Thanks for providing some color/that makes a lot of sense. There’s a lot of stuff WinFW doesn’t play nice with these days. Thank Costanza for the robot that invented VLANs!