Skip to content

Instantly share code, notes, and snippets.

@RomelSan
Last active September 8, 2023 05:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save RomelSan/a24e775301ea88213f2b92c022c13569 to your computer and use it in GitHub Desktop.
Save RomelSan/a24e775301ea88213f2b92c022c13569 to your computer and use it in GitHub Desktop.
List privileged services that don't come with Windows 10
# List privileged services that don't come with Windows 10
# Exclusion List for Win10 built in
$exclusion = @('AppVClient', 'ClickToRunSvc', 'COMSysApp', 'diagnosticshub.standardcollector.service',
'msiserver', 'ose', 'perceptionsimulation', 'SecurityHealthService', 'Sense',
'SensorDataService', 'SgrmBroker', 'Spooler', 'ssh-agent', 'TieringEngineService',
'TrustedInstaller', 'UevAgentService', 'vds', 'VSS', 'wbengine', 'WinDefend', 'wmiApSrv',
'WSearch', 'SamSs')
# Get Service List with LocalSystem and Startmode Auto and does not contain svchost.exe (Also exclude the ones from the list)
Get-WmiObject win32_service |
Where-Object {$_.StartName -eq 'LocalSystem' -and $_.Startmode -eq 'Auto' -and $exclusion -notcontains $_.Name -and $_.PathName -NotLike '*svchost.exe*'} |
Select-Object Name,StartName,Started,Startmode,PathName | Format-Table -AutoSize
# If you want to display almost all then type:
# Get-WmiObject win32_service | Where-Object {$_.StartName -eq 'LocalSystem' -and $_.PathName -NotLike '*svchost.exe*'} | select Name,StartName,Started,Startmode,PathName | ft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment