How to Test Remote Port Connectivity in Windows 11 Using Test-NetConnection in PowerShell

When troubleshooting remote server connectivity, database timeouts, or firewall blocks in Windows, administrators historically relied on third-party utilities or enabled the deprecated Telnet client feature. In modern Windows (Windows 11 and Windows 10), Microsoft provides a comprehensive, native networking diagnostic cmdlet: Test-NetConnection (aliased as tnc). This PowerShell utility combines the functionality of ping, traceroute, and TCP port verification into a single unified command.

Learning how to leverage Test-NetConnection allows you to audit open listening ports, test web services, and diagnose routing latency without installing external network scanners.

Basic Ping and ICMP Reachability Testing

To verify whether a remote server or domain name is reachable over standard ICMP ping:

  1. Right-click the Start button and select Terminal or PowerShell.
  2. Execute Test-NetConnection with the -ComputerName parameter:
Test-NetConnection -ComputerName digitash.com
  1. PowerShell displays an informative output block detailing DNS resolution, the resolved IPv4/IPv6 address, ping success status (PingSucceeded : True), and round-trip latency in milliseconds.

Testing Specific TCP Port Connectivity (Replacing Telnet)

The most powerful use of Test-NetConnection is verifying whether a specific remote TCP port is open through corporate firewalls, NAT routers, and cloud security groups:

  1. To test whether a remote database server accepts connections on MySQL port 3306:
Test-NetConnection -ComputerName 192.168.1.50 -Port 3306
  1. Inspect the decisive bottom line of the output:
TcpTestSucceeded : True
  1. If the result returns TcpTestSucceeded : False, the target host is either actively refusing the connection (the daemon service is stopped) or a firewall rule along the path is dropping packets.
  2. To speed up command entry in active terminal sessions, use the short alias:
tnc 192.168.1.50 -p 8080

Testing Common Protocols by Name

Instead of memorising port numbers, Test-NetConnection accepts predefined protocol flags via the -CommonTCPPort parameter:

  • To verify an active web server (HTTP / Port 80):
Test-NetConnection -ComputerName web01.local -CommonTCPPort HTTP
  • To verify Remote Desktop reachability (RDP / Port 3389):
Test-NetConnection -ComputerName win-server01 -CommonTCPPort RDP
  • Other recognized parameters include SMB (Port 445) for network file sharing shares.

Performing Path Tracing and Routing Diagnostics

If a remote host fails connectivity tests, append the -TraceRoute parameter to perform hop-by-hop route tracing alongside TCP analysis:

Test-NetConnection -ComputerName digitash.com -Port 443 -TraceRoute

PowerShell outputs every intermediate router IP address between your Windows 11 machine and the destination server, allowing you to pinpoint the exact network hop where traffic halts.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.