MoonPoint Support Logo


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals

Advanced Search
Sun Mon Tue Wed Thu Fri Sat
Jul Aug Sep
Oct Nov Dec

Fri, May 17, 2024 3:10 pm

View RDP Firewall Rule using PowerShell

If a Microsoft Windows system is running the Microsoft Defender Firewall, firewall software that comes with Microsoft Windows systems, you can check on whether connectivity is allowed on a particular network port from a command-line interface (CLI) using PowerShell. You can determine whether the Windows Firewall is active on a system from a command prompt using the command netsh advfirewall show currentprofile. If the value of "State" is "ON", then the Windows Firewall is active on the system.

C:\>netsh advfirewall show currentprofile

Domain Profile Settings:
State                                 ON
Firewall Policy                       BlockInbound,AllowOutbound
LocalFirewallRules                    N/A (GPO-store only)
LocalConSecRules                      N/A (GPO-store only)
InboundUserNotification               Enable
RemoteManagement                      Disable
UnicastResponseToMulticast            Enable

LogAllowedConnections                 Disable
LogDroppedConnections                 Disable
FileName                              %systemroot%\system32\LogFiles\Firewall\pfirewall.log
MaxFileSize                           4096



You can check on whether the firewall is permitting connectivity on a particular network port, e.g., TCP port 3389 for the Remote Desktop Protocol (RDP), from a PowerShell prompt, which you can obtain by typing powershell in the Windows "Search" field at the bottom of the screen and then clicking on Windows PowerShell when you see it returned by the search function. At the PowerShell prompt, you can issue the command Get-NetFirewallPortFilter | Where-Object { $_.LocalPort -eq 3389 } | Get-NetFirewallRule. If you wished to check on whether firewall connectivity is permitted for some other protocol, substitute the port used by that protocol, e.g., port 22 for Secure Shell (SSH) connections.

[ More Info ]

[/os/windows/software/security/firewall] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo