以下内容对我不起作用 -
%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Noninteractive -command "& Invoke-Command -ComputerName "Spider_LT_86" -ScriptBlock { msiexec.exe /i "D:\3PDInstallers\ETLBackgroundWorkerSetup.msi" /qn /l*vx "D:\3PDInstallers\logs" }"
我需要做的就是在远程机器上运行 msiexec。我假设运行脚本的用户需要访问远程机器。
即使计算机名称指向本地计算机,该脚本也不起作用(并且使用相同的登录用户运行 msiexec 可以正常工作,因此看起来不像权限问题) - 我已确保 WinRM 服务正在运行,而且我还禁用了防火墙以检查这是否是问题的原因,但到目前为止还没有运气。我在这里想念什么?
这是完整的错误,但它几乎列出了所有可能性 -
Connecting to remote server failed with the following error message : WinRM cannot process the request. The following error occured while using
Kerberos authentication: The network path was not found.
Possible causes are:
-The user name or password specified are invalid.
-Kerberos is used when no authentication method and no user name are specified.
-Kerberos accepts domain user names, but not local user names.
-The Service Principal Name (SPN) for the remote computer name and port does not exist.
-The client and remote computers are in different domains and there is no trust between the two domains.
After checking for the above issues, try the following:
-Check the Event Viewer for events related to authentication.
-Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport.
Note that computers in the TrustedHosts list might not be authenticated.
-For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting He
lp topic.
+ CategoryInfo : OpenError: (:) [], PSRemotingTransportException
+ FullyQualifiedErrorId : PSSessionStateBroken
更新:
当我仅使用用户名使用 -Credentials 时,它会弹出一个登录窗口以获取我的密码,然后在输入密码时出现以下错误 - 用户确实具有管理员访问权限,所以我不知道出了什么问题。
这
[spider_lt_86] 连接到远程服务器失败并显示以下错误消息:访问被拒绝。有关详细信息,请参阅 about_Remote_Troubleshooting 帮助主题。+ CategoryInfo : OpenError: (:) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionStateBroken