2013-02-13 70 views
0

我想在多个远程机器上安装应用程序。Powershell远程验证和应用程序安装

invoke-command -computer 10.13.14.10 -scriptblock {\\publicshare\software.msi /quiet}

我运行此命令从我的本地机器上登录为我的用户权限,好像我必须执行这个作为高权限的用户(域管理员)。我怎么做?

错误 - [10.13.14.10] Connecting to remote server failed with the following error message : The WinRM client cannot process the request. Default authentication may be used with an IP address under the following conditions: the transport is HTTPS or the destination is in the TrustedHosts list, and explicit creden tials are provided. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more informatio n on how to set TrustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (:) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionStateBroken

回答

0

要与另一用户执行此命令,只需使用凭证开关。因此,运行命令如下:

invoke-command -computer 10.13.14.10 -scriptblock {\\publicshare\software.msi /quiet} -Credential $(Get-Credential) 

这会给你一个用户名/密码的提示,您可以输入具有访问权限的用户的详细信息。

WinRM本身也可能存在问题,您确定您已经在远程机器上正确配置了它吗?运行winrm quickconfig以确保它已被配置。