san*_*ain 2 powershell-2.0 powershell-remoting
我想远程启用其他计算机上的powershell远程处理.远程计算机需要身份验证.我试图创建一个批处理文件来安排执行Enable-Psremoting的任务,显然我无法将它放在远程计算机中.
如果您在域中,则可以创建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"
Run Code Online (Sandbox Code Playgroud)
如果您正在为大量系统执行此操作,那么GPO可能是最好的 - 尽管您可以围绕该psexec版本包装PowerShell脚本以遍历计算机列表.
| 归档时间: |
|
| 查看次数: |
7387 次 |
| 最近记录: |