Skip to content

Instantly share code, notes, and snippets.

@SQLtattoo
Last active May 8, 2020 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SQLtattoo/07524b8abde2673fd27420dc9c4aeb71 to your computer and use it in GitHub Desktop.
Save SQLtattoo/07524b8abde2673fd27420dc9c4aeb71 to your computer and use it in GitHub Desktop.
Disabling multiple Windows services
# this populates a variable with all Windows Services starting with 'Microsoft Dynamics'
$svcs = Get-Service | where DisplayName -Like "Microsoft Dynamics*"
foreach($svc in $svcs)
{
Write-Host "Disabling service $($svc.Name)"
Set-Service -ServiceName $svc.Name -StartupType Disabled
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment