Troubleshoot Network connectivity issues via PowerShell

You can use the Test-NetConnection cmdlet to find out diagnostic information for a connection. It includes support for the Ping test, TCP test, route tracing, and also route selection diagnostics. Depending on which options are used, the output will consist of information such as ComputerName, RemoteAddress, SelectedSourceAddress, OutgoingInterfaceIndex, SelectedNetRoute, and more. Here is the list of supported parameters

CommonTCPPort: Specifies the typical service TCP port numberComputerName: Specifies the Domain Name System (DNS) name or IP address of the target computer.ConstrainInterface: Specifies the interface constraint to use for route diagnostics.ConstrainSourceAddress: Specifies the source address constraint to use for route diagnostics.DiagnoseRouting: Indicates that route diagnostics run to output the route and source address selection information for the remote host.Hops: Specifies the number of hops to traverse in a traceroute command.InformationLevel: Specifies the information level Detailed or QuietPort: Specifies the TCP port number on the remote computer.TraceRoute: Indicates that Tracert runs to test connectivity to the remote host.

Using the powerful Test-NetConnection cmdlet

List of Sample Commands

Here are a few sample commands you can try on your computer. Some of these commands will need admin privileges, so make sure to launch PowerShell 7 or PowerShell 5.1 with the required permission. More detailed information on the connectivity: When working with web services, it is to test a specific TCP port. Perform route diagnostics to connect to a remote host. Find the default port of a website Run Trace Route for a website That said, it is beneficial if you are on a non-windows platform but uses the same command as in Windows. Apart from this, I have also noticed executing commands for some websites like Microsoft.com. It doesn’t work. Ping fails all the time, which could be a server thing blocking such random requests.

Troubleshoot Windows Server Network connectivity issues via PowerShell - 58Troubleshoot Windows Server Network connectivity issues via PowerShell - 6Troubleshoot Windows Server Network connectivity issues via PowerShell - 62