Failed to initialize all required WMI classes

Tomek 16 Reputation points
2022-01-05T11:13:20.59+00:00

On my Windows 10 Pro 64-bit PC, when I go to WMI Control in Computer Management under "Services and Applications" and select "More Actions" -> Properties, it displays the following:-

Failed to initialize all required WMI classes.

Win32_Processor: WMI: Invalid class

Win32_WMISetting: WMI: Invalid class

Security information: Successful

Win32_OperatingSystem: WMI Invalid class

However, when I run command "winmgmt /verifyrepository" in an elevated command prompt (as advised in many web-pages) it reports: "WMI repository is consistent" which, I'm led to believe means the WMI Repository is NOT corrupt. Also winmgmt service is up and running.

How do I fix the Invalid class error?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,607 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Limitless Technology 39,351 Reputation points
    2022-01-10T08:29:02.357+00:00

    Thank you for your question and reaching out.

    I can understand you are facing issue WMI services.

    Ran the commands given below from Admin command prompt to reset WMI components and which should not be harm to other Windows services or components.

    From command prompt navigate to C:\>windows\system32\wbem

    regsvr32 /s %systemroot%\system32\scecli.dll

    regsvr32 /s %systemroot%\system32\userenv.dll

    regsvr32 cimwin32.dll

    mofcomp cimwin32.mof

    mofcomp cimwin32.mfl

    mofcomp rsop.mof

    mofcomp rsop.mfl

    for /f %s in ('dir /b /s *.dll') do regsvr32 /s %s

    for /f %s in ('dir /b *.mof') do mofcomp %s

    for /f %s in ('dir /b *.mfl') do mofcomp %s

    regsvr32 wmisvc.dll

    wmiprvse /regserver

    https://techcommunity.microsoft.com/t5/ask-the-performance-team/wmi-missing-or-failing-wmi-providers-or-invalid-wmi-class/ba-p/375485


    --If the reply is helpful, please Upvote and Accept as answer--

    20 people found this answer helpful.

  2. Darling, Eric 25 Reputation points
    2023-09-01T23:10:20.3266667+00:00

    We recently had this issue creep up on a few of our corporate devices after patching:

    winmgmt /verifyrepository - responds repository is consistent

    but in wmimgmt.msc WMI Control Properties we can see the errors:

    Failed to initialize all required WMI classes.

    Win32_Processor: WMI: Invalid class

    Win32 WMISettmg WMI Invalid class

    Security information Successful

    Win32_OperatingSystem WMI Invalid class

    Solution was discovered we needed to restore WMI Namespace class data, and found we diddnt need to research any needed .mof files by using the mofcomp and regSvr32 commands below. Note the commands are listed along with a restart of the Windows Management Instrumentation (WMI) service and gpupdate to test for any errors. Also note in several cases we had to run through the commands a few times until WMI and RSOP errors resolve.

    *** Recompile Mof files for WMI errors ***

    -run from elevated cmd prompt:

    cd C:\Windows\System32\Wbem

    for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s

    for %i in (*.dll) do regSvr32 -s %i

    net stop winmgmt /y

    net start winmgmt

    gpupdate /force

    5 people found this answer helpful.

  3. lolix3 166 Reputation points
    2022-10-05T09:39:16.53+00:00

    Note that .mfl file are in a subdirectory. Say C:\windows\system32\wbem\en-US

    3 people found this answer helpful.

  4. Castorix31 81,636 Reputation points
    2022-01-05T11:16:28.657+00:00

    Even if winmgmt /verifyrepository is OK,

    you can try :

    winmgmt /resetrepository
    
    1 person found this answer helpful.