Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that, in Windows, you could do the following to see what processes are attached to a port:

netstat -a -b

However, how would you limit the display to ports attached to a specific process? I looked at findstr but that doesn't help because the process' executable is not mentioned on the same line as the port information:

PS C:\Users\nimmylebby> netstat -a -b
 [svchost.exe]
  TCP    [::]:49154             NIMMY-LAPTOP:0         LISTENING
  Schedule
 [svchost.exe]
  TCP    [::]:49155             NIMMY-LAPTOP:0         LISTENING
 [services.exe]
  TCP    [::]:49156             NIMMY-LAPTOP:0         LISTENING
 [lsass.exe]
  UDP    0.0.0.0:500            *:*
  IKEEXT
 [svchost.exe]
  UDP    0.0.0.0:3702           *:*
  FDResPub
 [svchost.exe]

Anyone have any clue?

share|improve this question
up vote 2 down vote accepted

One option is to use Sysinternals TCPView, which includes a command line version that lets you filter on a process name:

Using Tcpvcon

Tcpvcon usage is similar to that of the built-in Windows netstat utility:

Usage: tcpvcon [-a] [-c] [-n] [process name or PID]

-a Show all endpoints (default is to show established TCP connections). -c Print output as CSV. -n Don't resolve addresses..

share|improve this answer
    
The page for TCPView apparently moved; it appears to be available under technet.microsoft.com/en-us/sysinternals/bb897437 now. – sleske Feb 8 '11 at 9:46
    
@sleske: Thanks. Updated. – zdan Feb 13 '11 at 1:31

You must log in to answer this question.

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