How to start stopped service on remote server

D Vijayakumar VLR 126 Reputation points
2021-03-27T12:16:57.86+00:00

Hi All,

I want to start stopped service on multiple remote servers could you please help on this it will be very helpfull for me

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,362 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 96,266 Reputation points MVP
    2021-03-27T13:06:58.473+00:00

    Hi @D Vijayakumar VLR ,

    Maybe this is helpful:

    $servers = "server1", "server2"  
    $serviceName = "wuauserv"  
    Foreach-Object ($server in $servers){  
           Get-Service -ComputerName $server -Name $serviceName | Set-Service -Status Running  
           }  
    

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments