Search Our Database

How to check if a port is open in Windows using PowerShell or Telnet

Last updated on |
by

Introduction

Verifying whether a specific port is open and accessible on a Windows system is an essential step in diagnosing connectivity issues, firewall restrictions, or service availability. For example, if a website is unreachable or an email service fails to connect, it’s often due to a blocked or closed port on the destination server or the local system.

Windows provides several methods to check port availability, including PowerShell and the Telnet client. These tools can help test if a port is open on a remote server or the local machine. This is particularly useful for system administrators, developers, or hosting users managing web servers, mail servers, FTP, and other network-based services.

 

Prerequisites

  • A system running Windows 7, 8, 10, 11, or Windows Server.
  • Administrator privileges (for Telnet installation).
  • IP address or hostname and port number of the target system.

 

Step-by-step Guide

Method 1: Using PowerShell (Recommended)

Step 1: Open PowerShell

  • Press Windows + S and type PowerShell.
  • Right-click Windows PowerShell and select Run as administrator.

 

Step 2: Run the Test-Port Command

Use the Test-NetConnection cmdlet to check if a port is open.

Test-NetConnection -ComputerName google.com -Port 443

Expected output (when port is open):

Expected output (when port is closed or blocked):

TcpTestSucceeded : False

 

 

Method 2: Using Telnet

Step 1: Enable Telnet (if not already installed)

  1. Press Windows + S, type Control Panel, and open it.
  2. Go to Programs 
  3. Go to Turn Windows features on or off.
  4. Check the box for Telnet Client and click OK.

 

Step 2: Use Telnet to Test Port Connectivity

telnet smtp.gmail.com 587

Successful connection: The window will go blank (connected).

Failed connection: You will receive an error like “Could not open connection to the host”.

⚠️ Important Note: Telnet sends data in plain text and is not secure. It should only be used for basic diagnostics, not in production environments.

 

Conclusion

Checking whether a port is open on Windows is a key diagnostic step in troubleshooting connectivity or service issues. PowerShell’s Test-NetConnection provides a modern and scriptable way to test TCP ports, while Telnet offers a basic, manual method.

These tools can help identify whether the issue lies with the local system, network configuration, firewall rules, or the destination server.

Should you have any inquiries about the guidelines, please feel free to open a ticket through your portal account or contact us at support@ipserverone.com. We’ll be happy to assist you further.