iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use the port-to-PID-to-service chain: find the endpoint with netstat or PowerShell, match its PID to the services hosted by that process, then inspect each service’s configuration and—when applicable—its ServiceDll. A PID match identifies the host process; if several services share that svchost.exe PID, it may not identify which individual service opened the socket.
Why svchost.exe alone does not explain a port
svchost.exe is a generic host process, not the service itself. Windows uses it to run internal services, including services implemented as DLLs. One host process may contain one service or several, so finding svchost.exe tells you which process owns an endpoint—not necessarily which hosted service created it. Microsoft describes the service-program hosting model, and documents that Windows can group or split services among host processes depending on system conditions and security requirements. Service host grouping and refactoring
First determine what the endpoint is
For TCP, LISTENING means a socket is waiting for incoming connections. ESTABLISHED means a TCP connection is active; TIME_WAIT is a recently closed connection, not proof that a service is accepting connections now. UDP has no TCP-style handshake or LISTENING state: investigate it as a locally bound endpoint.
Recommended Free Tools
0.0.0.0:PORTmeans an IPv4 wildcard bind, while[::]:PORTis an IPv6 wildcard bind. These indicate binding across applicable interfaces, not that an outside computer can necessarily reach the port.127.0.0.1:PORTand[::1]:PORTare loopback addresses, limited to traffic from the same machine.- A specific LAN address indicates a bind to that local address or interface.
A listening socket and remote exposure are separate questions. Binding, firewall rules, routing, and network segmentation affect reachability. Netstat reports active connections and listening TCP/UDP ports, with the owning PID available using -o.
#1 Best Overall
Find the PID that owns the port
Command Prompt: TCP
Open Command Prompt; for complete results across protected processes, run it as an administrator. Replace 3389 with the port number:
netstat -a -n -o | findstr ":3389"
To narrow the output to TCP listeners:
netstat -a -n -o | findstr "LISTENING" | findstr ":3389"
Read the local address, state, and final PID column. A broad snapshot is available with netstat -a -n -o. Adding -b attempts to show the executable associated with each endpoint, but may require elevation and take longer; use PID matching as the more useful service-mapping step.
PowerShell: TCP and UDP
For TCP endpoints on a particular local port:
$port = 3389
Get-NetTCPConnection -LocalPort $port |
Select-Object LocalAddress,LocalPort,RemoteAddress,RemotePort,State,OwningProcess
To list all TCP listeners in a structured view:
Get-NetTCPConnection -State Listen |
Sort-Object LocalPort |
Format-Table LocalAddress,LocalPort,OwningProcess,State
For a UDP endpoint:
Get-NetUDPEndpoint -LocalPort 5353 |
Select-Object LocalAddress,LocalPort,OwningProcess
Use the value in OwningProcess as the PID. If a query returns no rows, the endpoint may have closed, use another protocol, or not be bound to that local port at the moment you checked.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Map the PID to the hosted service or services
Suppose the PID from the endpoint output is 820. In Command Prompt, run:
tasklist /svc /fi "PID eq 820"
You can also run tasklist /svc to see services for all processes. In the results, find PID 820 and read the Services column. Microsoft documents /svc as the option that lists service information for each process. Tasklist command reference Microsoft also describes matching a port’s PID to a service as a troubleshooting method. Remote Desktop connection troubleshooting
If the row lists several service names, they share the same host process. The PID proves that the host owns the endpoint, but does not by itself establish which of those services bound it.
For service names plus configuration details, use PowerShell:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →$ownerPid = 820
Get-CimInstance Win32_Service |
Where-Object ProcessId -eq $ownerPid |
Select-Object Name,DisplayName,State,StartMode,StartName,ProcessId,PathName
Win32_Service exposes these service properties, including process ID, state, startup mode, account, and configured path. Win32_Service class reference
Inspect the service configuration and implementation
Check the configured command and account
For each service name identified above, query its Service Control Manager configuration:
sc.exe qc TermService
sc.exe query TermService
sc.exe queryex TermService
Substitute the actual service name for TermService. qc reports configuration such as binary path, service account, dependencies, service type, and display name. query reports state, while queryex includes extended process information. Microsoft’s sc.exe service configuration guidance and sc.exe query reference
Rank #3
You can retrieve a particular service’s details in PowerShell as well:
Get-CimInstance Win32_Service -Filter "Name='TermService'" |
Select-Object Name,DisplayName,State,StartMode,StartName,ProcessId,PathName
If PathName contains a command such as svchost.exe -k <group>, that identifies the shared host command line; it is not necessarily the DLL implementing the service.
Look up a DLL-backed service’s ServiceDll
For a service implemented as a DLL, check its service-specific registry key. Replace the example service name with the short service name returned by tasklist or PowerShell:
reg query "HKLMSYSTEMCurrentControlSetServicesTermServiceParameters" /v ServiceDll
The usual location is HKLMSYSTEMCurrentControlSetServices<ServiceName>Parameters, value ServiceDll. The value identifies a configured DLL path, not proof that the file is trustworthy or solely responsible for a socket. Record the full path, then check the file’s signature and publisher, version, and location. An unexpected user-writable directory merits closer scrutiny; a familiar name alone is not authentication.
When multiple services share the PID
Do not treat every service listed for one svchost.exe PID as a proven owner of its port. PID-level tools associate the endpoint with the host, and service/module inspection can narrow the possibilities, but may not uniquely attribute the socket among co-hosted services. Check each service’s role, configuration, DLL, and dependencies. Windows service grouping can vary by version, build, installed roles, updates, and system conditions.
Free tools Windows power users keep installed
One-click scans. No signup required.
If attribution must be tested, use controlled observation or a maintenance window. Stopping a service can disrupt dependent Windows or business functions, and it may restart automatically. Review dependencies and preserve the current output before making changes; do not terminate the entire shared svchost.exe process as a shortcut.
Investigate PID 4 and other non-svchost owners
If the PID maps to System (PID 4), the endpoint may belong to a kernel component or Windows networking subsystem rather than a conventional user-mode service. For HTTP.sys-related listeners, inspect the HTTP service state and reservations:
netsh http show servicestate
netsh http show urlacl
netsh http show sslcert
A PID 4 result may require investigating HTTP.sys, RPC, port proxying, drivers, or another kernel-managed facility. Do not force every endpoint into a service-DLL explanation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Catch a listener that appears only intermittently
Take repeated snapshots while reproducing the activity. This PowerShell loop samples TCP listeners once per second:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchwhile ($true) {
Get-NetTCPConnection -State Listen |
Select-Object LocalAddress,LocalPort,OwningProcess,State
Start-Sleep -Seconds 1
}
Stop it with Ctrl+C. For a short Command Prompt capture, repeat netstat with timestamps:
Best Value
for /l %i in (1,1,30) do @echo ==== %date% %time% ==== & netstat -ano & timeout /t 1 >nul
Save the output with its timestamp, since process ownership can change after restarts, recovery, reboot, or service regrouping. For live visual inspection, Microsoft Sysinternals TCPView displays TCP/UDP endpoints, addresses, state, owning process, and service name where available. Its command-line companion can capture endpoint output with tcpvcon -a -n. TCPView
Use Process Explorer to inspect the host process
- Run Process Explorer as administrator and locate the
svchost.exeinstance by the endpoint PID. - Open the process properties and review its image path, command line, account, loaded DLLs, signature information, and service tab where available.
- Compare loaded modules with the service’s
ServiceDllvalue and configuration.
Process Explorer can display process accounts, handles, DLLs, and memory-mapped files. In a shared host, seeing a DLL loaded is useful evidence but may not prove which service owns a particular socket. Process Explorer
Decide whether the listener is expected
A port number alone cannot establish whether activity is benign or malicious. Check the surrounding configuration and exposure:
- Does the service correspond to Windows functionality or software actually installed on this machine?
- Does the host image reside in the expected Windows directory, and is it digitally signed by the expected publisher? A filename of
svchost.exeby itself proves nothing. - Does the service’s account, startup mode, command line, and DLL path fit its role?
- Is the endpoint bound to loopback, a specific interface, or a wildcard address? What firewall rules apply to that interface and network profile?
- Does the service’s startup or recent configuration change make sense, and are there related event-log errors or unexpected changes?
A listener can exist while inbound traffic is blocked; conversely, an allowed firewall rule does not make a service reachable if it is bound only to loopback. Treat endpoint identification, service legitimacy, and remote reachability as separate findings.
What to preserve for support or incident response
- Timestamp, protocol, local address and port, TCP state if applicable, and remote endpoint if one exists.
- The command output showing the PID and the process image name and path.
- The complete service list for the PID, plus each relevant service’s configuration, account, startup mode, and command line.
- The
ServiceDllvalue and the DLL’s full path and signature details, if present. - Relevant firewall rules, the machine’s Windows edition/build, and whether the endpoint was observed once or repeatedly.
Do not change or delete a service or registry value before capturing evidence and assessing dependencies. If a service must be stopped, target the identified service only and plan for its operational impact.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

