Skip to content

Instantly share code, notes, and snippets.

@SQLtattoo
Last active May 8, 2020 14:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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