Display SvcHost processes

This script looks at all of the services running under svchost.exe (a generic wrapper) and tells which service is using which wrapper.
Version 1.0.1
Created on 2014-09-02
Modified on 2014-09-02
Created by ControlUp Support
Downloads: 578

The Script Copy Script Copied to clipboard
param (
    [string]$computer = "."
)
$results = (Get-WmiObject -Class Win32_Process -ComputerName $computer -Filter "Name='svchost.exe'" | % {
    $process = $_
    Get-WmiObject -Class Win32_Service -ComputerName $computer -Filter "ProcessId=$($_.ProcessId)" | % {
        New-Object PSObject -Property @{ProcessId=$process.ProcessId;
                                        CommittedMemory=$process.WS;
                                        PageFaults=$process.PageFaults;
                                        CommandLine=$_.PathName;
                                        ServiceName=$_.Name;
                                        State=$_.State;
                                        DisplayName=$_.DisplayName;
                                        StartMode=$_.StartMode}
     }
       }
)
$results