Monday, August 7, 2017

WMI is broken. "Configuration refresh failed with the following error: Invalid class"

Scenario:

When we start Server Manager on Windows Server 2012 R2 the flag lights up "Red" almost immediately with the error:
"Configuration refresh failed with the following error: Invalid class"


Get-WindowsFeature could end with the same "Invalid class" error.

Solution:

Backup WMI:

  • Launch the WMI MMC snapin by Start -> Run -> then enter WMIMGMT.MSC
  • Right click WMI Control (Local) and click Properties
  • Tab Backup/Restore, press Back Up Now...

Recompile .mof & .mlf files by running the following commands from an Elevated Command Prompt (Admin):
CD C:\Windows\System32\WBEM
dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s
Refresh "Server Manager" or re-open it.

References:

3 comments:

  1. Found solutions like this on several sites. But skipping the uninstall mofs is key!! Thanks. Got my (rather important) machine running again.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete