Disabling multiple Windows services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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