windows_firewall_toggle.ps1 - limehawk/rmm-scripts GitHub Wiki
windows_firewall_toggle.ps1
Toggle Windows Firewall on/off for all profiles.
Overview
Toggles Windows Firewall state for all profiles (Domain, Private, Public). If firewall is ON, turns it OFF. If firewall is OFF, turns it ON.
Purpose
Provides quick firewall toggle functionality for troubleshooting network connectivity issues on managed endpoints.
Prerequisites
- Windows 10/11
- Admin privileges required
Configuration
Required Inputs
None - script automatically detects current state and toggles.
Settings
- Affects all firewall profiles: Domain, Private, Public
- Toggle behavior: ON -> OFF, OFF -> ON
Behavior
- Queries current firewall state for all profiles
- Determines if firewall is currently enabled or disabled
- Toggles to opposite state
- Verifies new state
Security Notes
- No secrets in logs
- WARNING: Disabling firewall reduces system security
- Use with caution in production environments
Exit Codes
- 0: Success
- 1: Failure
Example Output
[ 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 ]
--------------------------------------------------------------
Version History
- v1.0.0 (2025-11-29): Initial Style A implementation
Links
- View Script Source
- Scripts - Back to script index