Would you like to learn how to test the TCP port connectivity using Powershell? In this tutorial, we are going to show you how to use Powershell to test the TCP connection to remote hosts.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Related tutorial – PowerShell

On this page, we offer quick access to a list of tutorials related to PowerShell.

Tutorial Powershell – Test the TCP port connectivity

As an Administrator, start a new POWERSHELL command-line prompt.

Windows 10 - powershell elevated

Test the connectivity to the TCP port using Powershell.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Test the connectivity to the TCP port using the quiet mode.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Test the connectivity to the TCP port using older Powershell versions.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Measure the response time of the connectivity to the TCP port.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Measure the response time of the connectivity to the TCP port using older Powershell versions.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You are able to test the TCP port connectivity using Powershell.

Tutorial Powershell – Test the TCP port connectivity using a script

As an Administrator, start a new POWERSHELL command-line prompt.

Windows 10 - powershell elevated

Create a text file containing the IP list or hostnames.

Copy to Clipboard

Create a text file containing the desired TCP ports.

Copy to Clipboard

Test the connectivity to the TCP ports using a Powershell script.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You are able to test the TCP port connectivity using a Powershell script.