How do I test whether a server TCP port is reachable from Windows?
Test-NetConnection can attempt a TCP connection to a named port. It is a useful first check for SSH, HTTPS or RDP reachability, but a successful TCP handshake does not prove that authentication or the application is healthy.
Instructions
1. Select the actual service port
Use the port assigned to the service. The following SSH example assumes port 22.
Test-NetConnection 203.0.113.10 -Port 22 -InformationLevel DetailedRead TcpTestSucceeded along with RemoteAddress, SourceAddress and the chosen interface.
2. Test the application separately
If TCP succeeds, run the actual client using its normal verification and authentication. For HTTPS, check the certificate and HTTP result; for SSH, verify the host key and account login.
3. Compare a specific failure path
If TCP fails, check that the server is running, listening on the chosen address, and permitted through both provider and operating-system firewalls. Compare another authorised client network only when that helps isolate a source-address restriction.
Check the result
- TcpTestSucceeded is True for the intended endpoint and port.
- The application’s own connection or health check also succeeds.
Troubleshooting
- Ping fails but the TCP check succeeds
- ICMP can be filtered while the service remains available.
- A UDP service is being tested
- The -Port check is TCP. It cannot establish whether a UDP service is usable; use that protocol’s approved client or diagnostic tool.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
