Netstat all open ports windows

Windows Netstat Command to Check Open Ports in Windows

In this tutorial, we will learn how to run the netstat command to check open ports in Windows Operating System. We will also look at command options and how to use the findstr command (similar to grep) to filter the netstat output.

To check open ports, open a command prompt (or PowerShell) as administrator and run the netstat command as follows:

netstat -aon

The command displays lots of information. What you should pay attention to are Local Addresses that are in the LISTENING state.

check if port is open windows

As you can see in the previous screenshot, In my Windows 10 computer, port 22 (SSH) is open.

Administrators can run the following command to show opened ports only without all other details:

netstat -aon | findstr /i listening

One important point is that the Windows Firewall may block a port even if it is in the listening state. In the Windows Defender Firewall with Advanced Security, there has to be a corresponding inbound firewall rule to match the listening port (Anything with a green checkmark is an open rule).

listening ports windows firewall

The Foreign Address column of the output shows the IP address and port of the computer/server at the remote end of the connection.

To check that the port is open from a remote computer, an administrator can run the telnet command from a remote computer against the IP address of the Windows computer.

For example, to check if port 22 is open, I will run the telnet command from a remote computer as follows:

telnet IP_ADDRESS 22

Replace IP_ADDRESS with the actual IP Address of the Windows computer.

check if port is open from a remote computer

Filtering netstat using findstr

Administrators can use the findstr CMD command (which is similar to grep) to filter netstat command data based on string patterns.

For example, run the following command to check TCP connections in TIME_WAIT State.

netstat -a | findstr /i TIME_WAIT

The /I option is for the case insensitive matching.

cmd netstat command to check open ports in windows

Command Options

Windows netstat command, without any command-line arguments, displays active TCP connections.

It also includes some useful command options to show network connections and ports in various forms, such as show connections and opened ports based on the protocol, find the process id of a connection/port, view network statics, and find the application that utilizes connections and ports.

-a displays all network connections and ports on which Windows is listening (include both IPv4 or IPv6 addresses).
-b The output shows you which applications are using each active connection and ports (need administrative privileges).
-e Displays network statistics, such as the Errors, the number of bytes, and packets sent and received.
-n Displays addresses and ports in numerical format.
-f When used, the output will contain Fully Qualified Domain Names (FQDNs) of IP addresses, if available.
-o Displays an additional column that contains the Process ID (PID).
-p Display data for a specific protocol (e.g., -p TCP). The Protocol can be one of the following: TCP, UDP, TCPv6, or UDPv6. If combined with the -s option, Protocol can be TCP, UDP, ICMP, IP, TCPv6, UDPv6, ICMPv6, or IPv6.
-r Check Windows routing table.
-s Displays detailed network statistics for each protocol (IPv4, IPv6, ICMPv4, ICMPv6, TCP, and UDP).
interval Sets Time interval (in seconds) to automatically update the output. See examples to learn more.

Examples: Using the netstat command

List all Active TCP connections:

netstat

Check open ports:

netstat -aon | findstr /i listening

Only want to see information about TCP protocol:

netstat -a -p tcp

Show network statistics:

netstat -s

Real-time network monitoring — In the following example, we set a 5 second time interval to check active network connections in real-time. The number 5 causes the command to repeat every five seconds (Press CTRL+C to quit).

netstat -n 5

If you need more information about the Windows netstat command, type netstat \? in the command prompt.

In another article, we explained computer ports and what they’re used for. Other than that, what can we do with port information? Since all traffic in and out of the computer goes through ports, we can check on them to see what they’re doing. Maybe the port isn’t listening for traffic? Maybe something is using a port that shouldn’t be? 

We’re going to use the Windows command netstat to see our listening ports and PID (Process ID). We’re also going to see what we can do with that information.

What Is Netstat?

The netstat command is a combination of the words ‘network’ and ‘statistics’. The netstat command works in all versions of Windows from Windows XP right up to Windows 10. It’s also used in other operating systems (OS) like Unix and Linux, but we’ll stick to Windows here.

Netstat can provide us with:

  • The name of the protocol the port is using (TCP or UDP).
  • The local IP address and name of the computer and the port number being used.
  • The IP address and port number to which we’re connecting.
  • The state of a TCP connection. For details on what these states are, read the Event Processing section of RFC 793.
  • Use the key combination Win Key + X. In the menu that opens, select Command Prompt.
  • Enter the command <pre>netstat -a -n -o</pre>. The parameters for netstat are preceded with a hyphen, not a forward slash like many other commands. The -a tells it to show us all active connections and the ports on which the computer is listening.

    The -n tells netstat to show the IP addresses and ports as numbers only. We’re telling it to not try to resolve the names. This makes for a quicker and neater display. The -o tells netstat to include the PID. We’ll use the PID later to find out what process is using a specific port.

  • View the results and take note of the addresses, port numbers, state, and PID. Let’s say we want to know what’s using port 63240. Note that its PID is 8552 and it’s connecting to the IP address 172.217.12.138 on port 443.

What’s Using That Port?

  • Open Task Manager. That’s most easily done by using the key combination Ctrl + Shift + Esc.
  • Click on the Details tab. To make this easier to find, click on the PID column header to sort the PIDs numerically.
  • Scroll down to PID 8552 and see what process it is. In this case, it’s googledrivesync.exe. But is it really? Sometimes viruses can make themselves look like legitimate processes.
  • In a web browser, go to ipinfo.io. Enter the IP address 172.217.12.138. As we can see, the IP address is registered to Google. So this googledrivesync.exe is a legitimate one.

How To Get Port, PID, & Process Name In PowerShell

PowerShell is Microsoft’s newer way to use a command-line interface with Windows. We say newer, but it’s been around for several versions. You should learn PowerShell even if you’re a home user.

Most Windows commands also work in PowerShell, plus we can combine them with PowerShell’s cmdlets – pronounced command-lets. Joe at Winteltools.com provides the script for this method.

  • Open Notepad and enter the following code:
$netstat = netstat -aon | Select-String -pattern "(TCP|UDP)"
$processList = Get-Process

foreach ($result in $netstat) {
   $splitArray = $result -split " "
   $procID = $splitArray[$splitArray.length – 1]
   $processName = $processList | Where-Object {$_.id -eq $procID} |    select processname
   $splitArray[$splitArray.length – 1] = $procID + " " +      $processName.processname
   $splitArray -join " "
}
  • Save the file as get-NetstatProcessName.ps1. Make sure to note where it’s being saved. It’s important to change the Save as type: to All Files (*.*) or it will get saved as get-NetstatProcessName.ps1.txt and it won’t work for us.
  • Open PowerShell and navigate to the location in which the script was saved. In this case, it’s <pre>cd C:\Scripts</pre>. Hit Enter to run the command.
  • Run the script using dot-sourcing to make it work. That means use ./ before the name of the file. The command will be <pre>./get-NetstatProcessName.ps1</pre> 
  • Now we can see all the traditional netstat info plus the process name. No need to open Task Manager anymore.

Go Get Them

We’ve covered two ways to use the netstat command to see listening ports. It can be used either in the old Command Prompt or within a PowerShell script. With the information it can give us, we’ve looked at how it can help us figure out what our computer is doing. 

If you thought netstat is a great utility, take a look at some other Windows TCP/IP utilities like tracert, ipconfig, and nslookup. Or use Resource Monitor to get a better look into hidden website and Internet connections. There is a lot you can do to see exactly what your computer is doing.

Have you used netstat to solve a problem? Please tell us what you did. Any questions about how to use netstat? Please ask us in the comments below.

It is essential to observe active network connections and the status of running TCP and UDP on different ports and addresses to discover network problems. Netstat is a command-line tool that enables users to check network connections. In this article, you will learn How to Use netstat Command in Windows. While facing internet access issues, netstat command helps you to identify the main problem.

Netstat has been present in Windows since 1993 when version 3.11 was released. After buying Windows VPS, you must be able to troubleshoot problems on your server which needs to use netstat command to check network activities and find out why a connection is not working. Join us with this article to learn all about netstat command and its usage.

What is netstat and how does it Work in Windows?

Netstat is formed from the phrases statistics and network and is a command-line tool that helps users to view the statistics of active connections on their computer or server. It is useful to check active network connections and troubleshoot problems. The netstat command assists you pinpoint the source of any issues you’re having when trying to access the internet. The status of each current network connection on your computer will be shown by netstat. The netstat can frequently offer further details about why a connection isn’t operating. Windows, Linux, and macOS support this network tool. Since netstat is a command line program, it does not feature a graphical user interface.

Previously on operavps, you taught that netstat is used to check open ports in Linux. To be aware of users who are trying to gain access to your Windows system, netstat will also be your powerful assist by monitoring your computer for security risks. This command tool does not show listening ports by default, but you can make it possible by adding the -l option to see the unusual listening ports.

It is not complicated to use netstat command in Windows. You just need to open a Command prompt/Terminal window and run ‘’netstat’’ followed by your considered option which will be explained in the following of this tutorial. So, stay with us to learn how to monitor and troubleshoot network problems and discover connected ports using netstat command in Windows.

The Basic Syntax of netstat Command

You can access the netstat services in Windows operating systems using the command line (cmd.exe). Because of this, Windows requires the command prompt, which can be launched whenever you want via ”Run” by pressing [Windows key] + [R] and typing “cmd.” To use the network tool on macOS and Linux, open the Terminal.

The syntax of the commands in netstat differs from system to system. However, the basic syntax is as follows that enables you to Use netstat Command in Windows.

netstat [-a] [-b] [-e] [-f] [-n] [-o] [-p Protocol] [-r] [-s] [-t] [-x] [-y] [Interval]

When combining multiple options, a preceding hyphen (-), which is customary for the listing of the parameters, only needs to be placed in front of the first link:

netstat [-OPTION1] [-OPTION2] [-OPTION3] …

With some simple steps, you can start using netstat in Windows:

  • Open Start and search for Command Prompt.
  • Select the Run as administrator option by right-clicking the top result.
  • Run the command below to view all active TCP connections.
  • Type: netstat

how to use netstat command to view network connections

  • For example, to observe all active connections showing numeric IP address and port number instead of trying to determine the names, type: netstat -n

Running netstat command in windows 11

Parameters of netstat Command in Windows

Option Command Description
netstat Standard listing of all active connections
-a netstat -a Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.
-e netstat -e Displays Ethernet statistics, such as the number of bytes and packets sent and received. This parameter can be combined with -s.
-n netstat -n Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.
-o netstat -o Displays active TCP connections and includes the process ID (PID) for each connection. You can find the application based on the PID on the Processes tab in Windows Task Manager. This parameter can be combined with -a, -n, and -p.
-p Protocol netstat -p TCP Shows connections for the protocol specified by Protocol. In this case, the Protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with -s to display statistics by protocol, Protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6.
-s netstat -s Displays statistics by protocol. By default, statistics are shown for the TCP, UDP, ICMP, and IP protocols. If the IPv6 protocol is installed, statistics are shown for the TCP over IPv6, UDP over IPv6, ICMPv6, and IPv6 protocols. The -p parameter can be used to specify a set of protocols.
-r netstat -r Displays the contents of the IP routing table. This is equivalent to the route print command.
interval netstat -n 5 Redisplays the selected information every interval seconds. Press CTRL+C to stop the redisplay. If this parameter is omitted, this command prints the selected information only once.
-q netstat -q Displays listening and non-listening ports
/? netstat /? Displays all the available parameters and additional help.
-y netstat -y Show connection template.
-x netstat -x Displays NetworkDirect connections. NetworkDirect is a specification for Remote Direct Memory Access (RDMA), which is a process that allows fast data transfers using the network adapter, freeing up the processor to perform other tasks.
-t netstat -t Displays offload state connections. A list of the current connection offload state will be generated when using this command. The offload state refers to the TCP Chimney Offload, which is a feature that transfers the network workload from the processor to the network adapter during data transmissions.

In the following of this tutorial, you will review some examples to understand better the above commands.

Why do Smart Users Use netstat Command in Windows?

Active network connections including incoming and outgoing, routing tables, listening ports, protocols such as IPv4 and IPv6, open and connected network ports, and so on would be discoverable if a user use netstat command in Windows.

You have a significant edge in the struggle against excessive traffic and harmful software if you are aware of the incoming and outgoing connections of your computer or server. These connections are made using the corresponding network address, which among other things identifies the port that was opened in advance for data exchange. These open ports provide a serious security risk because they give other parties a way to infiltrate your machine with malware. Additionally, there’s a chance that a Trojan that is already present in your system could set up a so-called backdoor and open a corresponding port as a result. Because of this, you should frequently verify the ports that your system has opened. The netstat is a great tool for this.

To use netstat command in Windows, the Internet Protocol (TCP/IP) protocol must be installed as a component in the properties of a network adapter for Network Connections. You can also learn about the packets transported since the last system started and any faults that happened thanks to the full statistics. The netstat can also be used to display the routing table, which provides details on how data packets go via the network.

Keep in mind that, before running netstat, all other programs, such as your web browser, should be closed because they frequently link to computers with unknown IP addresses, which can have an impact on the results.

Most Used Examples of netstat Command in Windows

Let’s continue this article to review the list of netstat command examples to help you understand the different usage of netstat commands in Windows.

1. IPv4 protocol Connections

As you know, you can use netstat command in Windows to display all active connections. But if you need to only view all active IPv4 connections, run:

netstat -p IP

2. Display Connections by Protocol

As we mentioned, netstat -p shows connections for the protocol specified by Protocol. To display your considered protocol, you just need to specify it to view a list of its connections.

netstat -p tcp 

Display Connections by TCP Protocol

netstat -p udp
netstat -p tcpv6
netstat -p udpv6

3. TCP and UDP protocols Statistics

The netstat command is capable to show the statistics for only the TCP and UDP protocols Statistics. Simply type:

netstat -s -p tcp udp

4. Using ICMPv6 Protocol to Access Statistics

Use the command below if you only want statistics on the ICMPv6 protocol:

netstat -s -p icmpv6

Using ICMPv6 Protocol to Access Statistics in windows

5. Show All Open Ports & Active Connections

You can use netstat command in Windows as below to view all open ports and active connections including numeric and process ID.

netstat -ano

Show All Open Ports & Active Connections in Windows

6. Display Ethernet & Protocols Statistics

Run the following command to view both the Ethernet statistics and the statistics for all protocols:

netstat -e -s

Display Ethernet & Protocols Statistics

7. Display Active TCP Connections Every 10 Seconds

To use netstat command in Windows for printing the process IDs and active TCP connections in your considered timing, run:

netstat -o 10

Display Active TCP Connections Every 10 Seconds in Windows

8. Display Active TCP Connections Using Numerical Form

It is possible to use netstat command in Windows for the purpose of showing active TCP connections and the process IDs using the numerical form. You just need to run:

netstat -n -o

 Display Active TCP Connections Using Numerical Form in Windows

9. Display FQDNS for Foreign Addresses

To view the Fully Qualified Domain Name for foreign addresses, run the command below:

netstat -f

Display FQDNS for Foreign Addresses in windows

10. Display Specific Connections Only

To show only the connections that are using a specific PID, you can use netstat command in Windows. Here, 28604 is an example.

netstat -0 | findstr 28604

The format of this command is also used to filter out the connections with a CLOSE_WAIT state, by replacing the PID with ESTABLISHED.

How to Highlight Only ”LISTENING” Connections?

You can produce only the specific details you require by following these procedures in addition to displaying all the available statistical information:

  • Open Start and Search for Command Prompt.
  • Select the Run as administrator option by right-clicking the top result.
  • To list all the connections that have the state set to LISTENING, run the command netstat -q | findstr STRINGIn. DO NOT FORGET TO replace STRING for the information you want to list.

search netstat details on Windows

The netstat utility does not provide the findstr command. Although it’s a straightforward command to look for a text string in a file, you may use it in conjunction with many other netstat commands to better understand the data you’re seeing. In addition to Windows Server, Windows 8.x, Windows 7, and earlier versions, you may find the netstat command in Windows 10. Additionally, the utility is not just limited to Windows; it is also accessible on Linux and macOS. Although the syntax and parameters may vary, they are all extremely similar.

FAQ

Anytime you need to view information about specific network connections as well as general and protocol-specific networking statistics, to aid in troubleshooting networking problems. The main function of the netstat command is to identify network issues and track network traffic for performance monitoring and strategic planning.

It shows the connection protocol (TCP or UDP).

The Foreign Address displays the IP address and port number of the remote computer to which the socket is connected. If the port is not yet established, the port number is shown as an asterisk (*).

As you read in the article, it is used for showing NetworkDirect connections. Unless you’re using the server edition of Windows or a high-performance program with a network adapter that supports this capability, you typically won’t use this command.

Track »Local Address» in the output. It shows the computer’s IP address followed by a semicolon with the port number of the connection. The double-semicolon inside brackets indicates the local IPv6 address, and «0.0.0.0» refers to the local address too.

The netstat command is available in the command prompt of Windows 11, Windows 10, Windows 8, windows 7, Windows Vista, and Windows XP.

Conclusion

In this article, you learned How to Use netstat Command in Windows to Check Network Connections. The netstat command is frequently used in conjunction with other Command Prompt tools for networking, including nslookup, ping, tracert, ipconfig, and others. From now on, you know how to list active networks’ (incoming and outgoing) connections as well as listening ports while using this tool. You may check statistics for both network adapters and specific protocols (like IPv4 and IPv6). Along with other things, you may even view the current routing table.

If you know some commands to get a better view of the network connections then the comment section is all yours.

Windows 10 netstart commands
Windows 10 netstart commands
(Image credit: Windows Central)

On Windows 10, netstat (network statistics) has been around for a long time, and it’s a command-line tool that you can use in Command Prompt to display statistics for all network connections. It allows you to understand open and connected ports to monitor and troubleshoot networking problems for system or applications.

When using this tool, you can list active networks (incoming and outgoing) connections and listening ports. You can view network adapter statistics as well as statistics for protocols (such as IPv4 and IPv6). You can even display the current routing table, and much more.

In this Windows 10 guide, we’ll walk you through the steps to use the netstat command to examine connections to discover open and connected network ports.

  • How to use netstat on Windows 10
  • How to use netstat parameters on Windows 10
  • How to search netstat details on Windows 10

How to use netstat on Windows 10

To get started with netstat, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to show all active TCP connections and press Enter:netstat

Windows 10 netstat command

Source: Windows Central (Image credit: Source: Windows Central)
  1. (Optional) Type the following command to display active connections showing numeric IP address and port number instead of trying to determine the names and press Enter:netstat -n

Netstat -n command

Source: Windows Central (Image credit: Source: Windows Central)
  1. (Optional) Type the following command to refresh the information at a specific interval and press Enter:netstat -n INTERVALIn the command, make sure to replace INTERVAL for the number (in seconds) you want to redisplay the information.This example refreshes the command in question every five seconds:netstat -n 5Quick note: When using the interval parameter, you can terminate the command using the Ctrl + C keyboard shortcut in the console.

Netstat interval command

Source: Windows Central (Image credit: Source: Windows Central)

Once you execute the command, it’ll return a list of all active connections in four columns, including:

  • Proto: Shows the connection protocol (TCP or UDP).
  • Local Address: Shows the computer’s IP address followed by a semicolon with a port number of the connection. The double-semicolon inside brackets indicates the local IPv6 address, and «0.0.0.0» refers to the local address too.
  • Foreign Address: Lists the remote device’s IP (or FQDN) address with the port number after semicolon port name (for example, https, http, microsoft-ds, wsd).
  • State: Indicates where the connection is active (established), the local port has been closed (time_wait), and the program hasn’t closed the port (close_wait). Other status include, closed, fin_wait_1, fin_wait_2, last_ack, listen, syn_received, syn_send, and timed_wait.

How to use netstat parameters on Windows 10

The tool also includes several parameters that you can use in Command Prompt to display different information about the network connections.

Show active and inactive connections

The

netstat -a

command displays all active and inactive connections, and the TCP and UDP ports the device is currently listening.

Netstat -a command

Source: Windows Central (Image credit: Source: Windows Central)

Show executable information

The

netstat -b

command lists all the executables (applications) associated with each connection. Sometimes, applications may open multiple connections.

Netstat -b command

Source: Windows Central (Image credit: Source: Windows Central)

Show network adapter statistics

The

netstat -e

command generates a statistic of the network interface, which shows information like the number of bytes, unicast and non-unicast sent and received packets. You can also see discarded packets and errors and unknown protocols, which can you troubleshoot networking problems.

Netstat -e command

Source: Windows Central (Image credit: Source: Windows Central)

Show FQDNS for foreign addresses

The

netstat -f

command shows the fully qualified domain name (FQDN) for foreign addresses. For example, «server-54-230-157-50.otp50.r.cloudfront.net:http» instead of «server-54-230-157-50:http» or «54.230.157.50».

Netstat -f command

Source: Windows Central (Image credit: Source: Windows Central)

Show numerical form

The

netstat -n

command displays the addresses and ports in numerical form. For example, 54.230.157.50:443.

Netstat -n command

Source: Windows Central (Image credit: Source: Windows Central)

Show process ID

The

netstat -o

command shows all active TCP connections like

netstat

, but with the difference that adds a fifth column to display the Process ID (PID) for each connection. The processes available in this view are the same in the «Details» tab of Task Manager, which also reveals the application using the connection.

Netstat -o command and Task Manager

Source: Windows Central (Image credit: Source: Windows Central)

Show connections by Protocol

The

netstat -p

can be used to display connections per-protocol that you have to specify using

tcp

,

udp

,

tcpv6

, or

udpv6

next to the command. For example, you can use the

netstat -p tcp

to view a list of TCP connections.

Netstat -p tcp

Source: Windows Central (Image credit: Source: Windows Central)

Show listening and non-listening ports

The

netstat -q

commands can produce a list of all the connections with the listening and bound non-listening ports.

Netstat -q command

Source: Windows Central (Image credit: Source: Windows Central)

Show statistics by Protocol

The

netstat -s

shows network statistics for all available protocols, including TCP, UDP, ICMP, and IP protocols (version 4 and 6).

Netstat -s command

Source: Windows Central (Image credit: Source: Windows Central)

Show routing table

The

netstat -r

command displays the current network routing table that lists all the routes to destinations and matrics known by the device, for IP version 4 and version 6 (if applicable). If the returned information looks familiar, it’s because you can also output the data using the

route print

command.

Netstat routing table

Source: Windows Central (Image credit: Source: Windows Central)

Show offload state connections

The

netstat -t

command generates a list of the current connection offload state. The offload state refers to the TCP Chimney Offload, which is a feature that transfers the network workload from the processor to the network adapter during data transmissions. The «InHost» value indicates that offloading isn’t enabled, and the «Offload» means that the feature is transferring the workload to the network adapter. (This feature is only present on supported network adapters.)

Show NetworkDirect connections

The

netstat -x

is another supported command on Windows 10, and it produces a list of NetworkDirect connections, shared endpoints, and listeners.

NetworkDirect is a specification for Remote Direct Memory Access (RDMA), which is a process that allows fast data transfers using the network adapter, freeing up the processor to perform other tasks. Usually, you’ll never use this command unless you’re using the server version of Windows or a high-performance application with a network adapter that supports this feature.

Show connection template

The

netstat -y

command displays TCP connections templates for all connections.

Netstat -y

Source: Windows Central (Image credit: Source: Windows Central)

Combine parameters

When using the

netstat

command, you can also combine the parameters to display various information together for many cases.

For example, the

-e

parameter can also be used with the

-s

parameter to see statistics for each available protocol, and the

-o

parameter can be combined with

-a

,

-n

, and

-p

as necessary.

Netstat -es command

Source: Windows Central (Image credit: Source: Windows Central)

With the

netstat -p

command, you append the

s

parameter, you can display statistics from even more protocols, including

icmp

,

ip

,

icmpv6

, and

ipv6

.

Also, when using more than one parameter, you can combine them with a single

-

. For example, instead of writing the command

netstat -e -s

, you can write it like this:

netstat -es

.

Netstat -es

Source: Windows Central (Image credit: Source: Windows Central)

If you want to see all the available parameters and additional help, you can always use the

netstat /?

command.

How to search netstat details on Windows 10

In addition to displaying all the available statistic information, you can also output only the certain details you need using these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to list all the connections that have the state set to LISTENING and press Enter:netstat -q | findstr STRINGIn the command, make sure to replace STRING for the information you want to list. Also, the findstr option is case sensitive, which means that you must enter the string you want to find with the exact casing.This example lists all the connections that have the state set to «LISTENING.»netstat -q | findstr LISTENINGThis other example shows all the connections from a foreign server FQDN, in this case, Amazon:netstat -f | findstr amazonAs you can see, you only need to type part of the string to return a result.

Netstat with findstr

Source: Windows Central (Image credit: Source: Windows Central)

The findstr command isn’t part of the netstat tool. It’s a simple command to search for a text string in a file, but you can use it with many of the netstat commands to make more sense of the information you’re viewing.

The netstat command is available on Windows 10, but you can also find it on Windows Server, Windows 8.x, Windows 7, and older versions. The tool is not exclusive to Windows either, as it’s also available across platforms, including Linux and macOS. Even though the parameters and syntax may be different, they all are very similar.

All the latest news, reviews, and guides for Windows and Xbox diehards.

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he’s a recognized member of the Microsoft MVP community.

I have trouble identifying the application using port 25 on my Windows-10 system. Any useful hints to list used ports and using applications without 3rd party applications ?

asked Jan 12, 2016 at 14:49

Younes Regaieg's user avatar

0

Without the use of any external software. Open a command prompt:

  1. netstat -abn

OR

  1. netstat -a -n -p tcp -o

Within Task Manager -> Processes/Details Tab

You can match the PID against the result of the second netstat command above, you can then find the image name/end the process etc if required.

There’s also plenty of third party applications that can simplify the process and make the information easier to read, simple Google search if you want to find them.

answered Jan 12, 2016 at 14:57

Samuel Nicholson's user avatar

Samuel NicholsonSamuel Nicholson

1,5442 gold badges13 silver badges26 bronze badges

0

A GUI solution would be to use the Resource Monitor of Windows. You can start it by pressing START and entering this command: Perfmon /Res

Then you can click on the Network tab to view all network connections, listening ports, etc.

Here is a screenshot of what it looks like:
Resource Monitor network tab

jkmartindale's user avatar

answered Jan 12, 2016 at 15:05

masgo's user avatar

masgomasgo

2,1841 gold badge16 silver badges32 bronze badges

0

Open a command shell and run

netstat -a -n -p tcp -o

No need to run as administrator.

The last column is the PID. You can look up this PID in the task manager. Be sure to activate «show processes of all users» there.

See the documentation for netstat.

answered Jan 12, 2016 at 14:58

user544199's user avatar

The post requests responses without third party apps, however, others reading this may be more inclined toward a GUI.

For those looking for an application, TCPView seems to work best.

It is microsoft recommended and has a clear and easy to use GUI.

https://learn.microsoft.com/en-us/sysinternals/downloads/tcpview

answered Mar 7 at 10:15

Gunty's user avatar

GuntyGunty

1116 bronze badges

1

All of you were way behind. A far easier method (was, & still is in 2023) is first to open the Command Prompt.
(can do this by holding the windows logo key on your keybard+Cut&Paste, or just type in these 3 letters> cmd.
So, Winlogo+cmd)
Than type in or Copy(Ctrl+C), & Paste(Ctrl+V)
*To terminate running process:

cmd>TASKLIST

[choose the task you want to terminate,than:]

cmd>taskkill /IM [program name ie:]mswebview2.exe /F

*Typing help in cmd gives options after running something
too. Sometimes, it may even provide an example,
that’s how the above EASY method was obtained-
after very minimal tial & error.
So the very easy way after the tidbits above:

  1. windowslogo+cmd

  2.             TASKLIST
    
  3.             taskkill /IM [program name ie:]mswebview2.exe /F
    

EASY METHOD + no «3rd.party» software .)

answered Apr 8 at 13:44

Friend's user avatar

1

Old now, but I use this powershell (saved as simplens.ps1):

$procs = Get-Process

$ports = netstat -ano
$ports[4..$ports.length] |
    # First column comes back empty, so we set to "ProcessName" as a placeholder for later
    ConvertFrom-String -PropertyNames ProcessName,Proto,Local,Remote,State,PID  | 
    where  State -eq 'LISTENING' | 
    foreach {
        $_.ProcessName = ($procs | where ID -eq $_.PID).ProcessName
        $_
    } | 
    Format-Table

answered Sep 11 at 21:24

Joel Coehoorn's user avatar

Joel CoehoornJoel Coehoorn

28.1k15 gold badges88 silver badges133 bronze badges

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

  • Netspeedmonitor windows 10 64 bit
  • Net view системная ошибка 1231 windows 10
  • Net user администратор active yes windows 10
  • Net user administrator active yes не найдено имя пользователя windows 10
  • Netsh advfirewall firewall set rule group windows management instrumentation wmi new enable yes