Skip to main content
InSource Solutions

How to check for Open Ports using Windows Powershell

Description

 

  • Author: Mike Viteri
  • Published: 3/7/2022
  • Applies to: Windows Server

Details

In the past PortQry was used to check for open ports.

Now using Windows Powershell you can check ports with the build in software instead of third party software.

To test a Port open Windows Powershell by clicking on the start menu and typing "Power"

clipboard_e3035be78a5450aa3fd602369a1f6300c.png

The PowerShell will open

clipboard_e78b0a1c13df0991e00a2d104d321e662.png

 

Type the following command to see if the Remote Desktop port is open on your local computer

Test-NetConnection -Port 3389 -Computer localhost

clipboard_eb60a73967823f2734035250909480bcb.png

If you check "TcpTestSucceeded" it says false. It failed as Remote Desktop is not turned on

If the port is changed to 80 "TcpTestSucceeded" is True as port 80 is open

 

clipboard_e2be356ac7529a449d3b8c7cffa06464f.png

If you want to test a remote PC change localhost to the remote IP Address to test