-
Retrieves the configuration details of the Windows Firewall service:
sc qc MpsSvc
-
Checks the current status of the Windows Firewall service:
sc query MpsSvc
-
Stops the Windows Firewall service:
sc stop MpsSvc
-
Starts the Windows Firewall service:
sc start MpsSvc
- Opens the Windows Firewall settings in the command-line interface:
netsh advfirewall firewall
-
Displays the help menu for Windows Firewall advanced settings:
netsh advfirewall /?
-
Shows available options for displaying firewall settings:
netsh advfirewall show /?
-
Displays the current firewall profile:
netsh advfirewall show currentprofile
-
Shows the firewall settings for the public profile:
netsh advfirewall show publicprofile
-
Shows the firewall settings for the private profile:
netsh advfirewall show privateprofile
-
Displays settings for all firewall profiles:
netsh advfirewall show allprofiles
-
Disables the Windows Firewall:
netsh firewall set opmode disable
-
Enables the Windows Firewall:
netsh firewall set opmode enable
-
Turns off the firewall for all profiles:
netsh advfirewall set allprofiles state off
-
Turns on the firewall for all profiles:
netsh advfirewall set allprofiles state on
-
Displays help for firewall rule commands:
netsh advfirewall firewall /?
-
Dumps the current firewall configuration:
netsh advfirewall firewall dump
-
Opens TCP port 23 for Telnet Server:
netsh firewall add portopening tcp 23 "Telnet Server"
-
Displays the current state of the firewall:
netsh firewall show state
-
Adds a rule to allow inbound FTP client connections:
netsh advfirewall firewall add rule name="Permit FTP Client" dir=in action=allow enable=yes profile=any program=%SystemRoot%\System32\ftp.exe
-
Displays all configured firewall rules:
netsh advfirewall firewall show rule
-
Displays details of the "Permit FTP Client" rule:
netsh advfirewall firewall show rule name="Permit FTP Client"
-
Allows inbound RDP traffic on port 3389:
netsh advfirewall firewall add rule name="RDP" dir=in action=allow enable=yes profile=any protocol=TCP localport=3389
-
Deletes the "RDP" rule:
netsh advfirewall firewall delete rule name="RDP" dir=in
- Modifies the "HTTP 80" rule to allow traffic on additional ports (80, 81, 82, 83):
netsh advfirewall firewall set rule name="HTTP 80" new localport=80,81,82,83 action=allow
-
Lists all firewall rules:
get-netfirewallrule -all
-
Lists all firewall rules from the configurable service store:
get-netfirewallrule -policystore configurableservicestore -all
-
Checks the status of Windows Defender:
sc query windefend
-
Retrieves the configuration details of Windows Defender:
sc qc windefend