2

我想在其他计算机上远程启用 powershell 远程处理。远程计算机需要身份验证。我试图创建一个批处理文件来安排执行 Enable-Psremoting 的任务,显然我无法将它放在远程计算机中。

4

1 回答 1

7

如果您在域中,则可以创建 GPO 以启用远程处理。请参阅http://www.briantist.com/how-to/powershell-remoting-group-policy/

您还可以使用psexec远程执行 PowerShell(请参阅底部的“whatyousay”的答案),enable-psremoting作为脚本传入执行。

psexec \\[computer name] -u [admin account name] -p [admin account password] -h -d powershell.exe "enable-psremoting -force"

如果您要为大量系统执行此操作,那么 GPO 可能是最好的 - 尽管您可以在psexec版本周围包装一个 PowerShell 脚本以循环遍历计算机列表。

于 2013-07-10T18:45:10.847 回答