Just noticed the result for process ‘0’ with process name “unknown”. That’s because the socket is still available but probably in a CLOSE_WAIT state. This query is refined a bit to only show the tcp ports that are in LISTENING state, and also shows the IP address(s) on which the socket is listening (as it’s sometimes useful to be able to filter to specific network addresses or filter out loopback-only listeners)
q: (pid of process of it as string | "Unknown", name of process of it | "unknown", local address of it, local port of it) of sockets whose (tcp of it and listening of tcp state of it and local port of it is contained by set of ( 80;443;8080;8083;3389;52311)) of network
A: 1180, svchost.exe, 0.0.0.0, 3389
A: 3748, BESWebReportsServer.exe, 0.0.0.0, 8080
A: 3748, BESWebReportsServer.exe, 0.0.0.0, 8083
A: 3884, BESRootServer.exe, 0.0.0.0, 52311
A: 1180, svchost.exe, 0:0:0:0:0:0:0:0, 3389
A: 3748, BESWebReportsServer.exe, 0:0:0:0:0:0:0:0, 8080
A: 3748, BESWebReportsServer.exe, 0:0:0:0:0:0:0:0, 8083
A: 3884, BESRootServer.exe, 0:0:0:0:0:0:0:0, 52311