In this post, I will share a useful PowerShell script that helps in monitoring the status of the Windows Firewall on your system. This script will check whether the firewall is enabled or disabled and can provide alerts if any changes are detected. Proper firewall configuration is crucial for maintaining network security.
powershell
$firewallStatus = Get-NetFirewallProfile | Select-Object Name, Enabled
$firewallStatus | ForEach-Object {
Write-Host "Profile: $($_.Name) - Status: $($_.Enabled)"
}
$logPath = "FirewallStatusLog.txt"
$firewallStatus | Out-File -FilePath $logPath -Append
Write-Host "Firewall status logged to $logPath."
$disabledProfiles = $firewallStatus | Where-Object { $_.Enabled -eq $false }
if ($disabledProfiles) {
Write-Host "WARNING: The following firewall profiles are disabled:"
$disabledProfiles | ForEach-Object { Write-Host $_.Name }
} else {
Write-Host "All firewall profiles are enabled."
}Run it across your fleet
This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.
More in Security & Auditing
Enable the Windows Firewall with PowerShell
2026-08-17Check Windows Firewall Status with PowerShell
2026-08-17Disable SMBv1 with PowerShell
2026-08-17Enforce TLS 1.2 in the Registry with PowerShell
2026-08-17Enable RDP Network Level Authentication with PowerShell
2026-08-17Audit the Local Administrators Group with PowerShell
2026-08-17Ready when you are.
Try ServerEngine free for 7 days.