Test remote network port connection in Windows 10

In Windows 10, there is an ability to check the connection to a certain port on a remote machine. This is possible thanks to PowerShell. So, no third party tools are required and you can do it natively.

PowerShell is an advanced form of command prompt. It is extended with a huge set of ready-to-use cmdlets and comes with the ability to use .NET framework/C# in various scenarios. If you have the skill to write scripts, you can create some very powerful ones to automate Windows.

One of its cmdlets, Test-NetConnection, can be used to check the connection to a remote address and to a custom port specified by the user.

It has the following syntax:

Test-NetConnection -ComputerName COMPUTER_NAME -Port PORT_NUMBER

Use it as follows.

Test remote network port connection in Windows 10

  1. Open PowerShell
  2. Type the following command:
    Test-NetConnection -ComputerName COMPUTER_NAME -Port PORT_NUMBER

    Replace the COMPUTER_NAME portion with the actual remote PC name or IP address. Specify the port you need to connect to instead of the PORT_NUMBER portion.

For example, let's test the connection to the DNS port (53) of the public Google DNS server (8.8.8.8). The command will look as follows:

Test-NetConnection -ComputerName 8.8.8.8 -Port 53

The output:The line TcpTestSucceeded: True indicates that the connection was successful and the port 53 is open.

If you try to connect to some random port, which is closed for incoming connections, the Test-NetConnection cmdlet will respond with the following information:

The output indicates that the connection has failed. The line TcpTestSucceeded has the value "False", but the cmdlet shows additional information that the target server is alive. It pinged the destination address and includes the results in the output. See the lines:

PingSucceeded          : True
PingReplyDetails (RTT) : 48 ms

For some servers, you may face the situation where PingSucceeded is False but TcpTestSucceeded is True. It just means that ICMP Ping is disabled on the target server but the destination port is open for incoming connections.

The cmdlet Test-NetConnection is one of the most useful PowerShell cmdlets. It saves your time and extends the built-in network diagnostics functionality in Windows 10.

The Test-NetConnection cmdlet is available in Windows 8.1 too.

That's it.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

One thought on “Test remote network port connection in Windows 10”

  1. what i do to open that port ? allready open it on my modem but still Port 30120 is closed on 109.131.175.13.

    WARNING: TCP connect to (8.8.8.8 : 30120) failed
    ComputerName : 8.8.8.8
    RemoteAddress : 8.8.8.8
    RemotePort : 30120
    InterfaceAlias : Ethernet
    SourceAddress : 192.168.1.11
    PingSucceeded : True
    PingReplyDetails (RTT) : 10 ms
    TcpTestSucceeded : False

Leave a Reply

Your email address will not be published.

Exit mobile version
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.