Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 506 Bytes

Misc-Windows-Firewall.md

File metadata and controls

16 lines (13 loc) · 506 Bytes

Monitor Logs

Set-NetFirewallProfile -LogAllowed True
Set-NetFirewallProfile -LogBlocked True
Set-NetFirewallProfile -LogIgnored True
Get-Content c:\windows\system32\LogFiles\Firewall\pfirewall.log -tail 1 -wait

Set all firewall rules applied to Public profile with Inbound to Private only

Get-NetFirewallRule | 
Where-Object { ($_.Profile -like 'Any' -or $_.Profile -like 'Public') -and $_.Direction -like 'Inbound' -and $_.Action -like 'Allow'} | 
Set-NetFirewallRule -Profile "Private"