How to run a command against multiple servers simultaneously in Powershell

前端 未结 3 558
夕颜
夕颜 2021-01-21 23:06

I am looking for a way to restart three services on multiple servers simultaneously. I know how to restart services against a list of servers by using a loop but as I have many

3条回答
  •  滥情空心
    2021-01-21 23:45

    you can use the invoke-command cmdlet invoke-command -computername computer1,computer2,computer3 {restart-service servicename}

提交回复
热议问题