Skip to content

Instantly share code, notes, and snippets.

@Fuwn
Last active December 18, 2022 22:48
Show Gist options
  • Save Fuwn/0da38bb8657a18e3d2daad6565ca5b1d to your computer and use it in GitHub Desktop.
Save Fuwn/0da38bb8657a18e3d2daad6565ca5b1d to your computer and use it in GitHub Desktop.
A PowerShell script to list external services that have been installed separately from the base Windows experience. I.e., user-installed services.
foreach ($service in Get-Service | ForEach-Object { $_.Name }) {
$path = Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\$service | ForEach-Object { $_.ImagePath }
# Change this as you see fit, but it should catch most externally installed services.
if ($path -like "*C:\Windows*") {
continue
}
"{0}: {1}" -f $service, $path | Write-Output
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment