-
Notifications
You must be signed in to change notification settings - Fork 5
windows_firewall_toggle.ps1
Corey Watson edited this page Dec 1, 2025
·
1 revision
Toggle Windows Firewall on/off for all profiles.
Toggles Windows Firewall state for all profiles (Domain, Private, Public). If firewall is ON, turns it OFF. If firewall is OFF, turns it ON.
Provides quick firewall toggle functionality for troubleshooting network connectivity issues on managed endpoints.
- Windows 10/11
- Admin privileges required
None - script automatically detects current state and toggles.
- Affects all firewall profiles: Domain, Private, Public
- Toggle behavior: ON -> OFF, OFF -> ON
- Queries current firewall state for all profiles
- Determines if firewall is currently enabled or disabled
- Toggles to opposite state
- Verifies new state
- No secrets in logs
- WARNING: Disabling firewall reduces system security
- Use with caution in production environments
- 0: Success
- 1: Failure
[ CURRENT STATE ]
--------------------------------------------------------------
Domain Profile : ON
Private Profile : ON
Public Profile : ON
[ OPERATION ]
--------------------------------------------------------------
Firewall is currently ON
Turning firewall OFF...
[ NEW STATE ]
--------------------------------------------------------------
Domain Profile : OFF
Private Profile : OFF
Public Profile : OFF
[ RESULT ]
--------------------------------------------------------------
Status : Success
Action : Firewall disabled
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
- v1.0.0 (2025-11-29): Initial Style A implementation
- View Script Source
- Scripts - Back to script index