How to view windows update error codes in cmd or powershell

Dustin Jordan 5 Reputation points
2024-04-17T19:33:52.8333333+00:00

Trying to update windows PCs silently on powershell remotely and running into failed installs. Is there a way to view the error codes from cmd or powershell? Need the ones that show in the windows update gui

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Darrell Gorter 2,731 Reputation points
    2024-04-17T21:21:12.4166667+00:00

    Hello,

    You may want to try this tool.

    https://learn.microsoft.com/en-us/windows/win32/debug/system-error-code-lookup-tool

    Depending on what you are doing in the OS, the description may change per component, byt this is the underlying code. The component/Feature may have more specific wording that what is displayed here.

    Darrell

    0 comments No comments

  2. Dustin Jordan 5 Reputation points
    2024-04-17T21:25:40.3966667+00:00

    basically I am just running windows updates in powershell through an RMM tool and getting failed installs. I want to know why it is failing with an error code


  3. Anonymous
    2024-04-18T02:29:56.6066667+00:00

    Hello,

    Yes, you can view the error codes for failed Windows updates in PowerShell by following these steps:

    Open PowerShell as an administrator.

    Type the following command and press Enter: Get-WindowsUpdateLog

    This will generate a log file in the %windir%\WindowsUpdate.log location.

    Open the log file and search for the error codes associated with the failed updates. The error codes will be listed in the format of 0x########.

    You can also use the following PowerShell command to view the error codes for failed updates:

    Get-WindowsUpdate -History | Where-Object { $_.Update.State -eq 'Failed' } | Select-Object -Property Title,KB,SupportUrl,UpdateId,RevisionNumber,LastDeploymentChangeTime,State,FailureReason,ResultCode

    This command will display a list of failed updates along with their error codes.

    Best Regards,

    Hania Lian

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.