wusa.exe 返回代码 5 是什么意思?

wusa.exe 返回代码 5 是什么意思?

我正在尝试安装通过 chocolatey 在服务器上运行 powershell 4.0。失败原因:

[错误] [错误] 使用 C:\Users\jdearing\AppData\Local\Temp\chocolatey\Powershell4\Powershell4Install.msu /quiet /norestart /log:"C:\Chocolatey\lib\powershell4.4.0.0.20131204\tools\PowerShell.v4.Install.log" 运行 wusa.exe 失败。退出代码为“5”。

应用程序日志中没有找到任何内容,而且该日志似乎是二进制数据。我找不到 wusa.exe 的返回代码列表。

答案1

Windows 更新不允许您通过 Powershell 远程会话执行安装,因为它不允许任何远程身份验证令牌。这不仅会影响常规更新的运行,还会影响通过 dism 和 servermanager 以及许多 Microsoft MSI 安装 Windows 功能。看起来 Windows Management 4 就是其中之一。解决此问题的最佳方法是创建一个计划任务以在远程计算机上执行此操作。如上所述,只要文件访问端口打开,并且如果您不在域环境中,则 PSEXEC 也可以工作,并且您已启用 LocalAccountTokenFilterPolicy。

我最近将此功能添加到 Boxstarter.org 2.0 版中。通过此功能,您可以远程安装 chocolatey 软件包、Windows 功能或 Windows 更新,Boxstarter 将从远程 powershell 会话中创建计划任务。它会将输出流回您的会话,因此看起来和感觉就像是在会话内部运行一样。请参阅http://boxstarter.org/InstallingPackages#RemoteInstallations了解详情。

简而言之,该命令如下所示:

$cred=Get-Credential username
Install-BoxstarterPackage -ComputerName box1,box2 -Credential $cred -PackageName Powershell4

相关内容