多台服务器的停机时间

huangapple go评论47阅读模式
英文:

Downtime multiples servers

问题

I need run this script for multiples servers.

somewhere can help?

enter image description here

I try:

$S = 'srv01','srv02'
ForEach ($Server in $S) {}
   $TotalDownTime 


But run only localhost.
英文:

I need run this script for multiples servers.

somewhere can help?

enter image description here

I try:

$S = 'srv01','srv02'
ForEach ($Server in $S) {}
   $TotalDownTime 


But run only localhost.

答案1

得分: 1

使用Invoke-Command在远程机器上运行您的代码:

$S = 'srv01','srv02'
Invoke-Command { script } -ComputerName $S
英文:

Use Invoke-Command to run your code on remote machines:

$S = 'srv01','srv02'
Invoke-Command { script } -ComputerName $S

答案2

得分: 0

我尝试,但显示此消息
cmdlet Where-Object在命令管道位置2
为以下参数提供值:
Property:

英文:

I try but, but show this message
cmdlet Where-Object at command pipeline position 2
Supply values for the following parameters:
Property:

huangapple
  • 本文由 发表于 2023年2月8日 23:29:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75388055.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定