You can download PortQry from http://www.microsoft.com/downloads/en/details.aspx?familyid=89811747-c74b-4638-a2d5-ac828bdc6983&displaylang=en
Download the PortQryV2.exe package and run it to extract the PortQry.exe program, EULA and readme file. I typically copy PortQry.exe to my %SystemRoot% folder so I can run it from any directory.
Here are some examples of how to use PortQry from the command line:
- portqry -n servername -e 80 – Queries remote computer servername to check if it’s listening on TCP port 80 (HTTP).
- portqry -n servername -p UDP -o 37,88,135 – Queries the remote computer to check if it’s listening on UDP ports 37, 88 and 135.
- portqry -n 10.0.0.21 -r 1-1024 – Queries the IP address to determine if it’s listening on any of the well-known TCP ports. The output will display each port and whether it’s listening or not listening.
- portqry -n 10.0.0.21 -r 1:1024 | find “: LISTENING” – Same as above, but only lists open ports.