Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

Troubleshooting COMException HRESULT: 0x80240024 in Windows PowerShell Script

The Problem: A user encounters a COMException with the HRESULT code 0x80240024 while running a PowerShell script. The error message is as follows:

3 7971f918-a847-4430-9279-4a52d1efe18d                       False System.__ComObject
Exception from HRESULT: 0x80240024
At line:45 char:1
- $Downloader.Download()
- ~~~~~~~~~~~~~~~~~~~~~~
    - CategoryInfo          : OperationStopped: (:) [], COMException
    - FullyQualifiedErrorId : System.Run

Analysis of the Problem: This error typically occurs when there is an issue with the Windows Update Agent (WUA) or a related COM object. The script in question likely attempts to use the IUpdateDownloader interface to download updates, but fails due to a misconfiguration or corruption in the WUA components.

Symptoms include:

  • The script halts execution at the $Downloader.Download() line.
  • The error message indicates a problem with a COM object.
  • The HRESULT code 0x80240024 corresponds to WU_E_NO_UPDATE, meaning no updates are available or an issue with the update service.

Root Cause: The root cause of this issue can be attributed to one or more of the following:

  • Corrupted Windows Update components.
  • Misconfigured or outdated Windows Update Agent.
  • Insufficient permissions to execute the script or access the COM object.
  • Network issues preventing the script from accessing the update server.

Solution: Follow these steps to resolve the COMException HRESULT: 0x80240024 error:

  1. Reset Windows Update Components: Use the following commands to stop the Windows Update services, rename the SoftwareDistribution and Catroot2 folders, and then restart the services.

    # Stop Windows Update Services
    net stop wuauserv
    net stop cryptSvc
    net stop bits
    net stop msiserver
    
    # Rename SoftwareDistribution and Catroot2 folders
    ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
    ren C:\Windows\System32\catroot2 Catroot2.old
    
    # Start Windows Update Services
    net start wuauserv
    net start cryptSvc
    net start bits
    net start msiserver
  2. Re-register Windows Update DLLs: Re-register the Windows Update DLLs using the following commands:

    regsvr32.exe atl.dll
    regsvr32.exe urlmon.dll
    regsvr32.exe mshtml.dll
    regsvr32.exe shdocvw.dll
    regsvr32.exe browseui.dll
    regsvr32.exe jscript.dll
    regsvr32.exe vbscript.dll
    regsvr32.exe scrrun.dll
    regsvr32.exe msxml.dll
    regsvr32.exe msxml3.dll
    regsvr32.exe msxml6.dll
    regsvr32.exe actxprxy.dll
    regsvr32.exe softpub.dll
    regsvr32.exe wintrust.dll
    regsvr32.exe dssenh.dll
    regsvr32.exe rsaenh.dll
    regsvr32.exe gpkcsp.dll
    regsvr32.exe sccbase.dll
    regsvr32.exe slbcsp.dll
    regsvr32.exe cryptdlg.dll
    regsvr32.exe oleaut32.dll
    regsvr32.exe ole32.dll
    regsvr32.exe shell32.dll
    regsvr32.exe initpki.dll
    regsvr32.exe wuapi.dll
    regsvr32.exe wuaueng.dll
    regsvr32.exe wuaueng1.dll
    regsvr32.exe wucltui.dll
    regsvr32.exe wups.dll
    regsvr32.exe wups2.dll
    regsvr32.exe wuweb.dll
    regsvr32.exe qmgr.dll
    regsvr32.exe qmgrprxy.dll
    regsvr32.exe wucltux.dll
    regsvr32.exe muweb.dll
    regsvr32.exe wuwebv.dll
  3. Ensure Sufficient Permissions: Make sure the script is run with administrative privileges. You can do this by running PowerShell as an administrator.

  4. Check Network Connectivity: Ensure that the system has a stable network connection and can reach the Windows Update servers. You can use the Test-NetConnection cmdlet to verify connectivity:

    Test-NetConnection -ComputerName www.microsoft.com
  5. Update Windows Update Agent: Download and install the latest Windows Update Agent from the Microsoft website. This can resolve issues caused by an outdated or corrupted agent.

By following these steps, you should be able to resolve the COMException HRESULT: 0x80240024 error and allow your PowerShell script to download updates successfully.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.