Use Test-NetConnection in PowerShell to See If A Port Is Open

The days of using ping.exe to see if a host is up or down are over. Your network probably shouldn’t allow ICMP to just fly around unaddressed, and your hosts probably shouldn’t return ICMP echo request (ping) messages either. So how do I know if a host is up or not?

Well, it involves knowing about what your host actually does. What ports are supposed to be open? Once you know that, you can use Test-NetConnection in PowerShell to check if the port is open and responding on the host you’re interested in.

Here I just checked if port 3389 (for RDP) is open or not. Looks like it is.

One thought on “Use Test-NetConnection in PowerShell to See If A Port Is Open

  1. So we don’t need telnet anymore neither!
    However, Test-NetConnection is only available on computer with at least Windows 8.1 or 2012 R2.
    Thanks for this reminder 🙂

Leave a Reply