[CBS] Error 80041002 When Installing Windows Updates

After being unable to install Windows Updates, the error code 80041002 may have been recorded when you checked the CBS logs. Here’s an excerpt from CBS.log:

000009a4 (F) Installer: Mof Binary Name: cmiadapter.dll ErrorCode: 80041002 Phase: 32 Mode: Install (upgrade) Component: Microsoft-Windows-NetworkProfile-CIM, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=amd64, versionScope=NonSxS[gle=0x80004005]

Error CSI 00000944@2023/1/4:13:48:41.970 (F) CMIADAPTER: Exiting with HRESULT code = 80041002 [Error,Facility=FACILITY_ITF,Code=4098 (0x1002)].

Error CSI 00000940@2023/1/4:13:58:12.594 (F) CMIADAPTER: Inner Error Message from AI HRESULT = 80041002 [Error,Facility=FACILITY_ITF,Code=4098 (0x1002)]

(or)

Error  CSI    00000b3a@2023/3/24:05:58:55.810 (F) Logged @2023/3/24:05:58:55.702 : [l:49 ml:50]'MOF (install online) $(runtime.wbem)\netprofm.mof'
[gle=0x80004005]
Error  CSI    00000b3b@2023/3/24:05:58:55.810 (F) CMIADAPTER: Inner Error Message from AI HRESULT = 80041002 [Error,Facility=FACILITY_ITF,Code=4098 (0x1002)]
 [
'An error occurred while creating object 1 defined on lines 14 - 39:
0X80041002 Class, instance, or property 'EventTrace' was not found.
'
]
[gle=0x80004005]
Error CSI    00000b3c@2023/3/24:05:58:55.810 (F) CMIADAPTER: AI failed. HRESULT = 80041002 [Error,Facility=FACILITY_ITF,Code=4098 (0x1002)]
    Element:
    ''
[gle=0x80004005]
Error  CSI    00000b3d@2023/3/24:05:58:55.810 (F) CMIADAPTER: Exiting with HRESULT code = 80041002 [Error,Facility=FACILITY_ITF,Code=4098 (0x1002)].
[gle=0x80004005]
Error      [0x018020] CSI    00000b3e (F) Failed execution of queue item Installer: Mof ({9f4ec79f-3a97-4772-b635-2899468900a2}) with HRESULT 80041002 [Error,Facility=FACILITY_ITF,Code=4098 (0x1002)].  Failure will not be ignored: A rollback will be initiated after all the operations in the installer queue are completed; installer is reliable[gle=0x80004005]

Cause

The above error referencing “Name: cmiadapter.dll ErrorCode: 80041002” is caused by a corrupt WMI repository.

Resolution

To resolve the WMI error 80041002 (“WBEM_E_NOT_FOUND”), repair, reset, or rebuild the WMI repository. Follow the method(s) below.

Note: To follow the instructions below, the admin Command Prompt should be enough in most cases. However, if you have an antimalware service (e.g., Malwarebytes) that depends on the WMI service, stopping WMI is difficult. In that case, you need to use the TrustedInstaller Command Prompt to complete the steps successfully.

Step 1) Repair the WMI repository

Open an admin Command Prompt window.

In the Command Prompt window , run the following commands to backup and repair the repository:

winmgmt /backup c:\wmirepository.bak
winmgmt /salvagerepository

Restart Windows. See if you’re able to install updates. If that doesn’t help, proceed to Step 2 below.


Step 2) Reset the WMI Repository

Open an admin Command Prompt, and run the following commands.

sc config winmgmt start= disabled

net stop winmgmt

(the blank space after start= is intentional)

When you see the following message, press Y

The following services are dependent on the Windows Management Instrumentation service.
Stopping the Windows Management Instrumentation service will also stop these services.IP HelperDo you want to continue this operation? (Y/N)

And then run the following command to reset the repository to Windows defaults:

winmgmt /resetrepository

sc config winmgmt start= auto

Restart Windows. If the problem persists, proceed to Step 3 below.


Step 3) Rebuild the WMI repository Completely

Open an admin Command Prompt, and run the following commands.

sc config winmgmt start= disabled

net stop winmgmt

(the blank space after start= is intentional)

Run the following commands to rebuild the repository:



CD /D %WINDIR%\System32\Wbem\Repository
DEL /F /Q /S %WINDIR%\System32\Wbem\Repository\*.*
CD /D %WINDIR%\System32\Wbem
for /f %s in ('dir /b *.dll') do regsvr32 /s %s
wmiprvse /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %s in ('dir /b *.mof') do mofcomp %s
for /f %s in ('dir /b *.mfl') do mofcomp %s
dism /online /cleanup-image /restorehealth
sfc /scannow

Launch wmimgmt.msc

Right-click “WMI Control (Local)” and click Properties.

wmi repository rebuild wmimgmt

The above step recreates the repository, which might take a minute or so.

Restart Windows.

If you still get the error 0x80041002 when installing an update, try one of the following:

1) Copy the %WINDIR%\System32\Wbem\Repository folder from another computer. You may need to stop the WMI service first.

or

2) Repair install Windows 10/11 using an in-place upgrade.

  • Download the Windows 10/11 ISO.
  • Double-click the ISO to mount it to a drive letter.
  • Run Setup.exe and complete the repair.
  • You should now be able to install Windows Updates.


    One small request: If you liked this post, please share this?

    One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
    • Pin it!
    • Share it to your favorite blog + Facebook, Reddit
    • Tweet it!
    So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

    Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

    Leave a Reply