What does wusa.exe return code 5 mean?

8,839

Windows update will not permit you to perform installs over Powershell Remote sessions since it does not allow any remote authentication token. This does not only affect the running of routine updates but also the installation of windows features via dism and servermanager as well as many Microsoft MSIs. Looks like Windows Management 4 is among them. The best way around this is to create a scheduled task to perform this on the remote machine. As noted above PSEXEC works too provided provided file access ports are open and, if you are not in a domain environment, you have enabled LocalAccountTokenFilterPolicy.

I recently added this functionality to Boxstarter.org as of version 2.0. With this you can install chocolatey packages, windows features or windows updates remotely and Boxstarter will create a scheduled task from the remote powershell session. It will stream the output back to your session so it looks and feels like it is running from inside the session. See http://boxstarter.org/InstallingPackages#RemoteInstallations for details.

In Short the command looks like:

$cred=Get-Credential username
Install-BoxstarterPackage -ComputerName box1,box2 -Credential $cred -PackageName Powershell4
Share:
8,839

Related videos on Youtube

Justin Dearing
Author by

Justin Dearing

.NET PHP and T-SQL Developer Accidental DBA Zend Certified Engineer, PHP5

Updated on September 18, 2022

Comments

  • Justin Dearing
    Justin Dearing almost 2 years

    I'm trying to install powershell 4.0 on a server via chocolatey. It fails with:

    [ERROR] [ERROR] Running wusa.exe with 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" was not success ful. Exit code was '5'.

    I get nothing in the application log, and that log appears to be binary data. I can't find a list of return codes for wusa.exe.

    • Admin
      Admin over 10 years
      Windows System Error Code 5 is Access Denied.
    • Admin
      Admin over 10 years
      Maybe because I was doing it from a psremoting session. Guess I'd need procmon to troubleshoot.
    • Admin
      Admin over 10 years
      I ran into a similar problem and the consensus online seems to be that wusa.exe does not work properly over PSRemoting. Most people (including myself) end up reverting to psExec to run wusa.exe remotely.