title: How to set service startup mode to manual or automatic for a variety of servers?
body: <p>First, I want to stop the services and then turn them on manually</p>
  
  <pre><code>$getservicestatus = (Get-Service -DisplayName $servicename -ComputerName $server).status
  
  if ($getservicestatus -eq "Running") {
      Set-Service -Name $servicename -ComputerName $server -Status Stopped            
  else
  {
      Write-Host "$server $servicename var redan Running!" -ForegroundColor Yellow
      Stop-Service spooler
      Set-Service spooler Manual
  </code></pre>