question

vijayakumarD-1665 avatar image
0 Votes"
vijayakumarD-1665 asked AndreasBaumgarten commented

How to start stopped service on remote server

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
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ vijayakumarD-1665 ,

does the provided answer work for you? Are there any additional related questions?

If you found the answer helpful, it would be great if you please mark it "Accept as answer". This will help others to find answers in Q&A


Regards
Andreas Baumgarten

0 Votes 0 ·

1 Answer

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered AndreasBaumgarten edited

Hi @vijayakumarD-1665 ,

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.