How to check open ports in windows server 2019

Last Updated: Feb 8, 2024 by

If you’re running a Windows Server 2019, it’s important to know which ports are open and which are closed. Open ports can leave your server vulnerable to attacks, while closed ports can prevent certain applications from functioning properly. In this article, we’ll discuss how to check open ports in Windows Server 2019 and why it’s important to do so.

Why Checking Open Ports is Important

Open ports are like open doors on your server, allowing data to come in and out. This can be beneficial for certain applications that require network connectivity, but it can also leave your server vulnerable to attacks. Hackers can exploit open ports to gain access to your server and steal sensitive information or cause damage.

By regularly checking open ports on your server, you can identify any potential vulnerabilities and take steps to secure them. This can help prevent cyber attacks and keep your server and data safe.

Raspberry Pi Firewall Open Ports

If you’re using a Raspberry Pi as a server, it’s important to check open ports on its firewall as well. The Raspberry Pi comes with a built-in firewall called “iptables” that controls network traffic. By default, the firewall is set to block all incoming connections, but you may have opened ports for specific applications.

It’s important to regularly check the open ports on your Raspberry Pi’s firewall to ensure that only necessary ports are open and that your server is secure.

How to Check Open Ports in Windows Server 2019

There are a few different methods you can use to check open ports in Windows Server 2019. We’ll go through each one below.

Using Command Prompt

The first method is to use the Command Prompt to check open ports. Here’s how:

  1. Open Command Prompt by typing “cmd” in the search bar and clicking on the Command Prompt app.
  2. Type in the following command: netstat -an
  3. Press Enter. This will display a list of all open ports on your server.
  4. You can also use the netstat -an | find /i “listening” command to only display open ports that are actively listening for connections.

Using PowerShell

PowerShell is another command-line tool that can be used to check open ports on your server. Here’s how:

  1. Open PowerShell by typing “powershell” in the search bar and clicking on the PowerShell app.
  2. Type in the following command: Get-NetTCPConnection
  3. Press Enter. This will display a list of all open ports on your server.
  4. You can also use the Get-NetTCPConnection | Where-Object {$_.State -eq “Listen”} command to only display open ports that are actively listening for connections.

Using a Port Scanner

Another method to check open ports is by using a port scanner. A port scanner is a software tool that scans a server for open ports and displays the results in an easy-to-read format.

There are many port scanners available, both free and paid. Some popular options include Nmap, Angry IP Scanner, and Advanced Port Scanner.

To use a port scanner, simply download and install the software, then run a scan on your server’s IP address. The results will show all open ports and their corresponding services.

How to Close Open Ports in Windows Server 2019

If you find that there are open ports on your server that you don’t need, it’s important to close them to prevent potential attacks. Here’s how to close open ports in Windows Server 2019:

  1. Open the Windows Firewall by typing “firewall” in the search bar and clicking on the Windows Defender Firewall app.
  2. Click on “Advanced settings” on the left-hand side.
  3. In the left-hand menu, click on “Inbound Rules.”
  4. In the right-hand menu, click on “New Rule.”
  5. Select “Port” and click “Next.”
  6. Choose whether you want to block TCP or UDP connections and enter the port number you want to block. Click “Next.”
  7. Select “Block the connection” and click “Next.”
  8. Choose which profiles you want this rule to apply to and click “Next.”
  9. Give your rule a name and click “Finish.”

This will create a new rule in your firewall that blocks the specified port. You can also use this method to block specific IP addresses or ranges.

How to Open Ports in Windows Server 2019

If you find that a necessary port is closed on your server, you can open it using the same method as above. Here’s how:

  1. Open the Windows Firewall by typing “firewall” in the search bar and clicking on the Windows Defender Firewall app.
  2. Click on “Advanced settings” on the left-hand side.
  3. In the left-hand menu, click on “Inbound Rules.”
  4. In the right-hand menu, click on “New Rule.”
  5. Select “Port” and click “Next.”
  6. Choose whether you want to allow TCP or UDP connections and enter the port number you want to open. Click “Next.”
  7. Select “Allow the connection” and click “Next.”
  8. Choose which profiles you want this rule to apply to and click “Next.”
  9. Give your rule a name and click “Finish.”

This will create a new rule in your firewall that allows the specified port. You can also use this method to allow specific IP addresses or ranges.

Conclusion

Checking open ports on your Windows Server 2019 is an important step in keeping your server and data safe from cyber attacks. By regularly checking for open ports and closing any that are unnecessary, you can prevent potential vulnerabilities and ensure the security of your server. Use the methods outlined in this article to check and manage open ports on your server.

Gulrukh Ch

About the Author: Gulrukh Ch

Gulrukh Chaudhary, an accomplished digital marketer and technology writer with a passion for exploring the frontiers of innovation. Armed with a Master's degree in Information Technology, Gulrukh seamlessly blends her technical prowess with her creative flair, resulting in captivating insights into the world of emerging technologies. Discover more about her on her LinkedIn profile.

Leave a Reply

Your email address will not be published. Required fields are marked *