为设置的计算机应用 `Enable-PSRemoting` cmdlet

Applying the `Enable-PSRemoting` cmdlet for set computers

PowerShell 4.0,Windows 域

来自get-help Enable-PSRemoting

You need to run this command only once on each computer that will receive commands.

好的,但是我们公司有 500 多台计算机...连接到每台计算机并在其上启动此 cmdlet 将花费大量时间。有解决这个问题的简单方法吗?

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

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

和(如果有必要)

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

psexe如果要在多台电脑的批处理中启动,可以用-d选项启动。