Testing Connectivity Over Any TCP Port

1. PowerShell Test-NetConnection

Since Windows 8.1/Server 2012 R2 you can now test/ping TCP connections over any port using PowerShell and the Test-NetConnection cmdlet.

The syntax for the command is as below. This tests if RDP (port 3389) is available/open on a server called ‘DC01‘ – you can change the hostname to an IP adress and you can use any port you like with the ‘-Port‘ switch:

Test-NetConnection DC01 -Port 3389

This should present results like the following with the key result being “TcpTestSuceeded: True” to signify that the port is indeed open:


If you run “Test-NetConnection” without specifying any parameters it will perform a test to determine if the device you are running the command on has access to the internet – this can be quite useful in a number of situations. When run on a client that does have Internet access you will see results similar to this:


2. paping.exe 

paping.exe is an invaluable tool for testing network connectivity, especially in a firewalled environment where using telnet isn’t straightforward and standard ICMP ping is blocked.

The tool basically allows you to send a “ping” over any TCP port which means that even if a firewall blocks ICMP pings, the paping.exe packet will be allowed through on a port that is open through the firewall.

A good example of this might be testing connectivity to an SCCM Distribution Point where SMB (TCP port 445) has been allowed through a firewall but standard ping is blocked: simply copy the paping.exe onto the machine you wish to initiate the connectivity test from and run the following command from a command prompt:

paping.exe [target hostname or IP address] -p 445

This will send a constant ping on TCP port 445 to the hostname or IP address specified. Brilliant.

Find the download for the tool at: http://code.google.com/p/paping/

3. PsPing.exe

Alternative tool that does the same thing is PsPing from the Sysinternals Suite:


/ JC

This entry was posted in PowerShell, Tools, Windows and tagged , , . Bookmark the permalink.

4 Responses to Testing Connectivity Over Any TCP Port

  1. Hawk says:

    I would like to use this for testing when a connection drops or gets blocked, is there a way to generate a log file?

  2. dance says:

    very useful, it developed two thumbs up

  3. ping Tool says:

    This pаge truly has all the infο I wanted about this subnect
    and didn’t know who to ask.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s