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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s