Firewall Port list through GPO
Hi
I have a query which returns all enable inbound ports. I would like to make a filter to the current script to check for open ports for certain ports- Some are in ranged port (49152-65535) and some of them are not...
Some questions I have:
- How do I make it possible to run on a remote Win10 client inside the Lan (I would like to choose an IP and then it will scan it)
- Does this command runs on the GPO FW rules or not?
- I want to be able to question a Linux machine with the same script. Can it be accomplished?
- How do I show the output on AsBuiltReport framework?
This is the query:
Get-NetFirewallRule -Action Allow -Enabled True -Direction Inbound |
Format-Table -Property Name,
DisplayName,
DisplayGroup,
@{Name='Protocol';Expression={($PSItem | Get-NetFirewallPortFilter).Protocol}},
@{Name='LocalPort';Expression={($PSItem | Get-NetFirewallPortFilter).LocalPort}},
@{Name='RemotePort';Expression={($PSItem | Get-NetFirewallPortFilter).RemotePort}},
@{Name='RemoteAddress';Expression={($PSItem | Get-NetFirewallAddressFilter).RemoteAddress}},
Profile
Thank you in advance.