Created
May 3, 2012 22:16
-
-
Save fenneh/2589906 to your computer and use it in GitHub Desktop.
Using PortQry to test Firewall Rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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