2013-02-13 68 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以確保它已被配置。