Lab Tasks
1. View Firewall Profiles
Check the status of all firewall profiles (Domain, Private, Public).
Get-NetFirewallProfile
2. Create Firewall Rule
Create a new inbound firewall rule to allow specific traffic.
New-NetFirewallRule -DisplayName "MyRule" -Direction Inbound -Action Allow
3. List Firewall Rules
Query and view existing firewall rules on the system.
Get-NetFirewallRule
4. Configure Logging
Enable firewall logging for blocked or allowed connections.
Set-NetFirewallProfile -Profile Domain -LogBlocked True
5. Test Network Connection
Use Test-NetConnection to verify connectivity to a remote host.
Test-NetConnection -ComputerName dc01 -Port 3389
Security Tip:
Always test firewall rules before deploying:
Always test firewall rules before deploying:
Get-NetFirewallRule -DisplayName "MyRule"
Tip: Use
Get-Command *NetFirewall* to discover all firewall cmdlets!