Does what it says on the tin really, found here.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$Computers = "FileServer01","FileServer02" $WmiObject = @{ Class = "Win32_Service" Filter = "StartMode=’Auto’ and State!=’Running’" } foreach ($Computer in $Computers) { foreach ($Svc in Get-WmiObject @WmiObject -ComputerName $Computer) { Write-Host "Starting the" $Svc.DisplayName "service on $Computer" $Svc.StartService() | Out-Null } } |