Test-NetConnection

Ping/port/traceroute diagnostics in one cmdlet.

Windowslow

Test-NetConnection checks connectivity to a host — ICMP ping, TCP port test, route and diagnostics.

Syntax

Test-NetConnection {host} [-Port {n}]

Example

Test-NetConnection example.com -Port 443

Tests TCP connectivity to port 443 on the host and reports success/latency.

Options & flags

What each switch does. Toggle them in the builder below to assemble a command.

-Port <443>TCP port to test.
-ComputerName <target.tld>Target host.
-TraceRouteRun a traceroute.
-InformationLevelDetailed/Quiet output.

Command builder

Tick options (and fill any values) to build a ready-to-copy command.

test-netconnection

Usage examples

Test-NetConnection target.tld -Port 443

Test TCP connectivity to 443.

Test-NetConnection target.tld -TraceRoute

Trace the route to a host.

Advantages
  • Ping + port + traceroute combined
  • Clear object output
  • Built into modern Windows
Disadvantages
  • Slower than raw ping
  • One host at a time
  • Windows-only
Tags
#windows#connectivity

Official docs: Test-NetConnection

Related commands

Frequently asked questions

What is Test-NetConnection used for?
Test-NetConnection checks connectivity to a host — ICMP ping, TCP port test, route and diagnostics.
What is an example Test-NetConnection command?
A common example is: Test-NetConnection example.com -Port 443 — Tests TCP connectivity to port 443 on the host and reports success/latency.
Is Test-NetConnection part of a standard install?
Test-NetConnection runs on Windows. It is typically available by default.
What category of security tool is Test-NetConnection?
Test-NetConnection is a PowerShell tool with a low-risk profile when run against a live target.

Try recon tools live

Run real scans against a domain you control, stage by stage.

Open the lab →