NMAP, PING vs Test-Connection, Test-NetConnection

When it comes to troubleshooting using simple tools it is very effective. The output of a simple test may infer that everything is working as expected, partially or in some other cases not working at all.

Consequently, this is generally also a fast way to identify where is the area that we need to focus our efforts or to validate the overall performances of our systems.

The most common tools that I use for network troubleshooting are:


It’s a very powerful network scanner.  It’s not installed by default on your operating system, except from some GNU/Linux security distribution (like Kali Linux).

“With great power comes great responsibility”.

Installing Nmap with APT (Debian, ubuntu, wsl , etc.):

With YUM (redhat, centos, etc.):

Check if multiple hosts are alive:


Ping command operates on ICMP protocol and checks if a host, identified by name or IP, is reachable and how fast it is responding (measuring latency) if some packets have been dropped it can also show congestions on your link/path.

But why don’t we use just PowerShell?

 PowerShell : Test-Connection

Do you need a boolean value as a result?


But what if we want to check if a port is open on a given host?

A simple way of checking if a port is open would be opening a telnet session

or using a port scanner like (nmap).

That can be handy for testing not just security purpose and that can be integrated into other scripts.

Checking open ports on multiple hosts:

IP range and network

Checking if specific ports are open

 PowerShell : Test-NetConnectionTest


There are other useful tools such netscanner from softperfect included in sysinternals.

Final Consideration

These tools are very effective and with a lot of features. Spending a couple of minutes reading the man page is definitely time well spent and can offer you new learning opportunities and sometimes the information you are looking for is described in one of the examples.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.