Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

February 22, 2007 12:00 AM

Using Netstat to Get a List of Open Ports

Windows IT Pro
InstantDoc ID #94752
Rating: (0)

Q: How can I get a list of all the open ports on my system and the programs that have them open?

A: The easiest way is to run Netstat, which is available on every Windows computer. Netstat displays all TCP and UDP connections and their respective states by default if you don’t supply any parameters. Note that this excludes ports in listening mode. Ports in listening mode are ports that a program has open but that don't necessarily have clients connected to them. To also see listening ports, run Netstat with the -a switch. By default, Netstat translates common port numbers into the protocol typically associated with them (e.g., port 25 is translated to smtp) and IP addresses are converted to their DNS names.

If you’d rather see the port and IP address numbers, use the -n switch. By default, Netstat doesn't identify the executable or process identifier (PID) associated with each port. The -b switch tells Netstat to display the specific service within the executable that opened the port. To get the PID of the process associated with each port, use the -o switch, which shows the same PID for a process as Task Manager does.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.