【问题标题】:Applying the `Enable-PSRemoting` cmdlet for set computers为设置的计算机应用 `Enable-PSRemoting` cmdlet
【发布时间】:2016-02-18 22:37:16
【问题描述】:

PowerShell 4.0,Windows 域

来自get-help Enable-PSRemoting

您只需要在每台计算机上运行一次此命令即可 接收命令。

好的,但是我们公司有 500 多台计算机...连接到每台计算机并在其上启动此 cmdlet 需要很长时间。是否存在解决此问题的简单方法?

【问题讨论】:

  • 他们在域中吗?很确定有一种方法可以通过组策略应用它,但我知道如何。不过多次运行它并没有什么坏处。
  • 是的,它们在 Windows 域中(我现在已添加此信息)。

标签: powershell powershell-4.0


【解决方案1】:

我已经通过Mark RussinovichPsExec.exe 完成了它。我可以从 Active Directory 中获取计算机名称,然后为它们中的每一个启动(通过 cicle):

psexec \\computerName powershell -Command "Enable-PSRemoting -Force"

和(如果有必要)

psexec \\computerName powershell -Command "Disable-PSRemoting -Force"

psexe 如果要在多台计算机的批处理中启动,可以使用-d 选项启动。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-30
    • 1970-01-01
    • 1970-01-01
    • 2017-10-18
    • 1970-01-01
    • 2013-04-10
    • 2014-08-08
    • 1970-01-01
    相关资源
    最近更新 更多