Using PortQry to test Firewall Rules
# Grab some user input | |
$Server = Read-Host "Enter the Server's name or IP" | |
$Port = Read-Host "Enter the Port Number" | |
# Be careful of this path~! | |
$K = C:\PortQryV2\PortQry.exe -n $Server -e $Port -p TCP | |
$L = $K -Match "LIS?" | |
If($L -ne $null) | |
{ | |
$res = $Port + " on " + $Server + " is " + "Open" | |
Write-Host $res | |
} | |
Else | |
{ | |
$res = $Port + " on " + $Server + " is " + "Closed" | |
Write-Host $res | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment