英文:
Downtime multiples servers
问题
I need run this script for multiples servers.
somewhere can help?
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?
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论