Change service startup type in multiple systems


Hi there,
This is a very simple script to view the actual status of a startup type of a service and change that status :).

#********************************************************

$ComputerName = gc “.\servers.txt”

Get-WmiObject Win32_Service -ComputerName $ComputerName | where{$_.Name -eq “SERVICE NAME”} | ft Name, StartMode, State, status, __SERVER

Set-Service -ComputerName $ComputerName -name “SERVICE NAME” -StartupType Disabled

Get-WmiObject Win32_Service -ComputerName $ComputerName | where{$_.Name -eq “SERVICE NAME”} | ft Name, StartMode, State, status, __SERVER

#********************************************************

That’s all.

Advertisements