Content

Admin Tools

Interesting Articles

   

Use Test-NetConnection to check whether a TCP port of a remote host is open - 05/Oct/2024

TCP Port Check PowerShell

You can use PowerShell to check whether a TCP port is responding in the network. To do this, open a PowerShell window and enter the Test-NetConnection command using the following syntax:

 


 PS C:\>
Test-NetConnection -ComputerName MyServer -Port 443


 ComputerName     : MyServer

 RemoteAddress    : 10.4.1.4

 RemotePort       : 443

 InterfaceAlias   : Ethernet

 SourceAddress    : 10.4.3.1

 TcpTestSucceeded : True

 

 

The TCP port check is also often referred to as TCP ping, although the term is actually incorrect.


Short form

PS C:\> tnc MyServer -Port 443

You can also omit the keyword “ComputerName”.

 

If the port is also omitted, a ping is executed:


 PS C:\>
tnc MyServer


 ComputerName           : MyServer

 RemoteAddress          : 10.4.1.4

 InterfaceAlias         : Ethernet

 SourceAddress          : 10.4.3.32

 PingSucceeded          : True

 PingReplyDetails (RTT) : 2 ms

 

 

If you want to run the command as a ping permanently (endless), the following one-liner is used:

 


 PS C:\>
while ($true) { "$(Test-Connection -ComputerName MyServer -Quiet)" }


 
True

 True

 True

 True

 True

 False

 False

 True

 True


 

 

Problem with the Test-NetConnection command: It takes a relatively long time, especially if the port does not respond.


Display results in color (green/red)

The small, portable command line tool PortCheck 3.0 is faster. This utility for Windows 11 displays the ports in red or green and has some additional functions. For example, you can display the date and time or log to a file (logfile). Even the displayed text can be modified so that, for example, “PM-2000 production machine not responding” is displayed instead of “10.5.1.1 - Port 25001 - closed”. Very interesting for non-IT-savvy users.

PortCheck tool features:

  • Displays permanently whether a TCP port is open or not

  • Shows response time in milli seconds with colored output (red/green)

  • Checks multiple devices simultaneously on multiple ports

  • Permanent logging with date and time possible

  • Acoustic signal if TCP port is not responding

  • ...

PortCheck is the perfect tool for administrators, network and firewall admins. You can read more about the TCP Port Check Tool for Windows 11 here. You can also find many examples there.

 

PingTool - TCP Port Check GUI

If you would like to have a TCP port check GUI, you can use PingTool 4.2 for Windows 11. PingTool is a free, powerful tool for administrators and network admins. It checks permanently if remote devices answer on specific TCP ports.

PingTool features:

  • Shows permanently the status of network devices (red/green)

  • Logs all status changes automatically (timestamp)

  • IP range scan - with vendors and MAC addresses

  • Checks if remote devices answer on particular TCP ports

  • Integrated speed test to determine the network bandwidth

  • Mail notification in the event of failure

  • ...

To check TCP ports, simply enter the TCP port number. Without port number, an ICMP ping will be performed. You can read more about the free Ping Tool here: www.ping-tool.com.

 

Often used standard TCP ports

A list of important TCP ports with port number:

TCP Port 21 - FTP (File Transfer Protocol)
TCP Port 22 - SSH
TCP Port 23 - Telnet
TCP Port 25 - SMTP
TCP Port 80 - HTTP
TCP Port 110 - POP3
TCP Port 135 - DCE / WMI
TCP Port 139 - NetBIOS
TCP Port 143 - IMAP4
TCP Port 443 - HTTPS
TCP Port 445 - SMB
TCP Port 1433 - MS SQL
TCP Port 1494 - ICA (Citrix)
TCP Port 1521 - Oracle
TCP Port 3389 - RDP
TCP Port 5060 - SIP
TCP Port 8080 - HTTP alternative
TCP Port 8443 - HTTPS alternative


>>> Change to the german TCP Port check PowerShell page

 

Content: Test-NetConnection / Check TCP Port PowerShell / TCP Port Checker / Test-NetConnection Command cmd / Examples / ping software (Windows) for IT professionals / Check TCP Port open PowerShell (TCP Ping)