Windows Firewall is a built-in component in Windows operating systems that allows you to control the incoming and outgoing network traffic and communications.
In this task, we will
use the Set-NetFirewallProfile
cmdlet to disable all Windows Firewall profiles, and then enable the firewall public profile.
#Disable all Firewall Profiles PS > Set-NetFirewallProfile –All –Enabled False #Enable Windows Firewall Public Profile PS > Set-NetFirewallProfile –Name Public –Enabled True
In this task, we will use the New-NetFirewallRule
cmdlet to create a new Windows Firewall rule.
This example explains how to create a firewall rule that blocks all outbound traffic to any FTP protocol.
PS > New-NetFirewallRule -Name "Block FTP" -DisplayName "Block FTP" -Direction Outbound -Action Block -Protocol TCP -LocalPort FTP