Testing Connectivity Over Any TCP Port

1. PowerShell

Since Windows 8.1/Server 2012 R2 you can now test/ping TCP connections over any port using PowerShell.

The syntax for the command is as below. This tests if RDP (port 3389) is available 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

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:

https://technet.microsoft.com/en-gb/sysinternals/jj729731

/ JC

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

3 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

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s