PowerShell's Test-NetConnection checks whether a Windows PC can reach a host or open a TCP connection. For a website, run Test-NetConnection -ComputerName example.com -Port 443 and read TcpTestSucceeded.
Use the server's real name and port. Without a port, the command tests ping instead. A successful TCP test confirms the connection, but the app can still have a login or server-side problem.
In this guide
Open Windows PowerShell and choose the target
In Windows 11, search Start for Windows PowerShell and open it. The same Start search works in Windows 10.
Test-NetConnection comes from NetTCPIP, Windows' set of networking commands. Use Windows PowerShell when another shell can't recognize the command.
A terminal window can contain different shells. Opening Command Prompt in a Windows Terminal tab doesn't make it understand PowerShell commands. Check the shell before treating an unrecognized command as a network failure.
For unfamiliar command names and parameters, practice the PowerShell basics with read-only examples.

Microsoft's Test-NetConnection reference lists ping, TCP tests, route tracing, and route selection checks. Decide what you want to check before running a command. That makes its result easier to read.
Use a host and service you're allowed to access. For a work server, ask its administrator for the hostname and service port. Guessing the port can give you a failed result even when the service works correctly on a different port.
Test the TCP port the application actually needs
For an HTTPS website, this example checks TCP port 443:
Test-NetConnection -ComputerName example.com -Port 443
Replace example.com with the server you need to reach. ComputerName takes a hostname or IP address, rather than a full web address with https://, a page path, or a sign-in query.
Read RemoteAddress and RemotePort to confirm what was tested. Then read TcpTestSucceeded. True means the TCP connection succeeded; False means it didn't complete from this computer at that time.
A failed ping warning can appear with a successful TCP result. That's possible when the destination doesn't answer ping but accepts the application's port. For a port check, read the TCP result to see whether it worked.
For example, a website might accept port 443 even though ping fails. Conversely, a server can answer ping while its web service is stopped. Don't substitute one result for the other.
I'd start with the application's port rather than a plain ping. It checks the connection the app needs and avoids treating a blocked ping reply as a complete internet outage.
Ask for more detail when the result needs explaining
Add -InformationLevel Detailed to show more of the connection information:
Test-NetConnection -ComputerName example.com -Port 443 -InformationLevel Detailed
Depending on the test, the output can show the hostname's addresses, network adapter, source address, and next stop along the route. These help explain which connection Windows chose on a PC with Ethernet, Wi-Fi, or a VPN.
RemoteAddress is the destination address selected for the test. SourceAddress is the local address used to reach it. InterfaceAlias names the network connection used, making an unexpected VPN or adapter easier to spot.
When a hostname won't resolve, check its spelling and whether it needs the work network or VPN. A private server name may not be available through the same name lookup service used by an ordinary public website.
To inspect published address, mail, or verification entries, choose the matching DNS record type before editing the domain.
If the administrator supplies a known destination IP, compare that address with the hostname using the same port. If the address works but the name doesn't, check how the name is being looked up.
The application may still require its proper hostname.
Use Quiet output when only a yes or no is needed
For a simple TCP result without the full display, use Quiet:
Test-NetConnection -ComputerName example.com -Port 443 -InformationLevel Quiet
The result is True or False, called a Boolean value. That's useful when your script only needs to choose its next action based on whether the connection worked.
Keep the detailed command handy for a failed check. A single False value doesn't tell you whether the name, selected interface, destination service, or network rule caused the failure.
For common services, -CommonTCPPort accepts HTTP, RDP, SMB, and WINRM. Use -Port instead when the service uses a custom port or when you want the tested number to be clear in the command.
After changing the Remote Desktop port, test that chosen number rather than the standard RDP port.
The Port parameter tests TCP, so it can't check whether a UDP service is responding. Use the service's own diagnostic tools for that.
The TCP test isn't a bandwidth measurement. If connections succeed but files transfer slowly, slow-download checks address a different part of the problem.
Keep ping and route checks separate
To test ping to a particular host, leave out the port:
Test-NetConnection -ComputerName example.com
Read PingSucceeded for the result. A failed response can mean ping traffic is filtered, so use the service's TCP port before deciding the destination is unavailable.
For a route trace, run a separate command:
Test-NetConnection -ComputerName example.com -TraceRoute
This asks about the path rather than a connection to a chosen TCP port. Don't add -Port to that command: route tracing and the remote-port test use different sets of command options.
For Windows' route selection details, use:
Test-NetConnection -ComputerName example.com -DiagnoseRouting -InformationLevel Detailed
That command helps show the route and source address Windows would select. It isn't the same as listing every responding hop. Say which command you used when sharing the result, because TraceRoute shows something different.
Turn the result into a useful next step
If the port succeeds but the app fails, check the app's exact error, credentials, and server configuration. A successful TCP result doesn't check your password, a certificate, a web response, or your permission to use a shared folder.
If one port fails while other services work, ask the service owner whether it is listening on that port and whether access from your network is allowed. Give them the target, port, time, and connection result.
On a Windows server you manage, add a narrowly scoped port rule after checking the required protocol and receiving port.
If many destinations fail, check the PC's network connection and the intended VPN first. A router setup check helps when the whole home network has lost access rather than one remote service.
For help with your work connection, send the Detailed output to your administrator through your usual private support channel. Include whether the same service works from another permitted connection.
Don't disable the firewall just to turn a failed result into True.
The Short Version
Use a hostname and the required TCP port, then read TcpTestSucceeded. Use Detailed for addresses and interface information, or Quiet for a Boolean result.
Treat ping and route tracing as separate checks, and send failed port details to the service owner.
Checked December 2, 2026.







