none
Server Manager 2012 : Configuration refresh failed with the following error: Invalid class

    Question

  • When we start Server Manager on Server 2012 the flag lights up Red almost immediately with the error:

    Configuration refresh failed with the following error: Invalid class. 

    What we’ve tried so far:  

    sfc /scannow  [reported no errors]

    Dism /Online /Cleanup-Image /RestoreHealth [Completed to 100% ]

    Get-windowsfeature returns: Invalid class

    This is a file/print server, running DFS.   When running DFS Management from Server Manager we don’t see the Replication section at the bottom.  We can run MMC and manually add DFS Management then Replication shows up. 

    Where do I look to start diagnosing this error?

    Wednesday, October 16, 2013 12:23 PM

Answers

All replies

  • I wanted to put the fix that I found on this thread since it's the first one that comes up in a web search, but didn't have the answer on it.

    1. from current directory (C:\Windows\System32) I did: dir /a /S *.mof then all *.mof's in all subdirs were listet.

    All are some type like "FFA7CB08C2CC2CB2D3973F6214D0CCAF.mof"

    2. cd C:\Windows\System32\wbem\AutoRecover

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

    4. goto Servermanager, do Refresh - Ok.

    • Marked as answer by BScholl Saturday, November 16, 2013 3:13 AM
    Friday, November 15, 2013 3:52 PM
  • Thank you!
    • Proposed as answer by Randall Okwei Monday, October 05, 2015 4:20 AM
    Saturday, November 16, 2013 3:13 AM
  • This worked magic for my Failover Cluster! thanks!!
    Thursday, December 12, 2013 10:22 PM
  • Thank you! I started having this issue when I attempted to uninstall the Windows Deployment Services role and I was stuck!
    Friday, December 27, 2013 4:05 PM
  • Fixed for me, thank you so much! This problem has been plaguing us with a DC for months, and this has fixed it perfectly!
    Monday, June 16, 2014 10:57 AM
  • Thanks a lot. It saved my day.

    L. Arshath

    Wednesday, January 07, 2015 9:13 AM
  • Open Powershell with "Run As Admin"

    And run command ....

    Set-Item wsman:\localhost\Client\TrustedHosts YOURSERVERNAMEHERE -Concatenate -Force

    Thursday, February 05, 2015 3:30 PM
  • for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s

    this did it for me - thanks so much for sharing!!

    • Proposed as answer by PedroTo Tuesday, December 06, 2016 10:44 AM
    Monday, March 09, 2015 6:41 PM
  • THAT WAS AWESOMESWAUCE!

    I tried this
    2. cd C:\Windows\System32\wbem\AutoRecover3. for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s

    and it worked great! Thank you so sooo much!

    Tuesday, May 19, 2015 1:02 PM
  • I stand corrected. That worked yesterday for the first refresh right after doing it, but then it went back to failing. Today it's not working at all.

    This server was recently promoted to being a Domain controller, I'd like to keep it in good health. :(

    Wednesday, May 20, 2015 12:48 PM
  • I am so glad that I found this post and your answers.  I was having a problem with a Windows Server 2012 system that would not let Windows Update get past "Searching for Updates".  This would just hang for days until I rebooted.  All of the other Windows Updates fixes did not work.  I was so close to rebuilding this server.

    After I ran through the steps outlined, I rebooted the server and all of a sudden the Windowes updates started working again.

    Thank you so very much!

    Tuesday, June 02, 2015 12:41 AM
  • Perfect!

    Works flawless with a HP ProLiant Cluster!

    Thanks!

    Wednesday, September 09, 2015 9:18 AM
  • this worked on a dell t 610, although the scripts been running for hours now.  stuck on it seems

    C:\Windows\System32\wbem\AutoRecover>mofcomp AC3687DA2224C8ED35AB56C9861A0C4B.mof
    Microsoft (R) MOF Compiler Version 6.3.9600.16384
    Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
    Parsing MOF file: AC3687DA2224C8ED35AB56C9861A0C4B.mof
    MOF file has been successfully parsed
    Storing data in the repository...

    Ironically this also fixed my hyper-v management console remote, and scvmm errors.

    Kudos!!!!!


    Sunday, October 04, 2015 9:48 PM
  • Thank you StuffNThings, it worked like a charm on a Windows Server 2012 R2 Foundation.

    My two cents:

    1) Never run the same command from %windir%\system32\wbem, do it just from AutoRecover dir, because in wbem there are several MOFs to uninstall WMI providers, and run a recursive mofcomp will completely blow up your WMI (it's the way I blew mine).

    2) During the recursive mofcomp the program hanged once registering a specific mof (which file name I do not remember, alas). Closing Server Manager was not enough, I had to kill WMIPrvSe.exe from Task Manager to unblock it. I tried before to stop the WMI Service - sorry, no luck! - my WMI was in a so bad state that was impossible to stop it from Service Manager. Once killed WMIPrvSe.exe, the recursive mofcomp finished in no time, and the problem was solved.

    Due to this problem I could not open Backupassist console (neither 8.4.4 or 9.0, reinstalling did not solve the issue). Clearly BA console relies on WMI, so when WMI was back in shape, BA console opened again.

    Note that in several threads they warned me to keep deleting the WMI repository as a last measure, because it causes weird behavior in programs. I resisted the temptation to rebuild it, and my patience was rewarded with the lean solution I found here.

    Monday, October 05, 2015 9:38 PM
  • Hope someone can help here still

    When I type #3 it gives me an errors until I do it like this

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

    Then I get >> and a flashing cursor for hours and nothing happens

    I need to get this fixed without doing a new install

    What am I doing wrong?

    Sunday, February 21, 2016 12:53 PM
  • Don't do it in Powershell, open a CMD window

    c:

    cd\

    cd C:\Windows\System32\wbem\AutoRecover

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

    Ignore next few lines, this app likes to insert this most likely due to the for statement data

    <object data-extension-version="0.4.0.129" data-install-updates-user-configuration="true" id="__symantecPKIClientMessenger" style="display:none;"></object>


    <object data-extension-version="0.4.0.129" data-install-updates-user-configuration="true" id="__symantecPKIClientMessenger" style="display:none;"></object>
    • Edited by jbruns2010 Tuesday, March 01, 2016 3:20 PM
    Tuesday, March 01, 2016 3:19 PM
  • From current directory (C:\Windows\System32) I did: dir /a /S *.mof then all *.mof's in all subdirs were listet.

    All are some type like "FFA7CB08C2CC2CB2D3973F6214D0CCAF.mof"

    after that type cd C:\Windows\System32\wbem\AutoRecover

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


    DMG

    • Proposed as answer by Aanand Kumar Tuesday, March 01, 2016 3:29 PM
    Tuesday, March 01, 2016 3:29 PM
  • What people should be asking is why do the autorecover files have to be recompiled.  I believe I was able to recreate this issue.

    This was on 2012 and 2012R2 only.  2008R2 does not appear to be affected by this.

    1.  Navigate to C:\Windows\System32\wbem

    2.  Recompile all *.mof and *.mfl

    3.  Open ServerManager(SM).  This is where SM dies with invalid class

    Now

    1.  Navigate to C:\Windows\System32\wbem\AutoRecover

    2.  Recompile all *.mof and *.mfl

    3.  Open ServerManager.  SM is fixed

    <object data-extension-version="0.4.0.129" data-install-updates-user-configuration="true" id="__symantecPKIClientMessenger" style="display:none;"></object>
    Tuesday, March 01, 2016 4:32 PM
  • THANK YOU!

    This worked for me and it solved my FILE SERVER RESOURCE MANAGER problem as well.  I posted the solution with a screen shot (and credit :) )

    http://www.urtech.ca/2016/07/solved-server-manager-2012-configuration-refresh-failed-with-the-following-error-invalid-class/

    Have a great day.


    Ian Matthews www.urtech.ca www.commodore.ca

    Tuesday, July 12, 2016 8:32 PM
  • I can confirm that recompiling .mof & .mlf files in $env:windir\System32\webem\AutoRecover\ fixes this. I did not recompile the files one level up, nor did I do a recursive search.. Thank you to the recent few who mentioned recompiling only the ones in the AutoRecover directory.

    I wrote this snippet in PowerShell, which fixed it for me. Proceed at your own risk:

    $AutoRecoverPath = "$env:windir\System32\wbem\AutoRecover\"
    
    Write-Output "Getting AutoRecover MOFs to recompile."
    $GetAutoRecoverMOFS = Get-ChildItem -Path $AutoRecoverPath | Where-Object { ($_.Extension -in ".mof", ".mfl") -and ($_.Name -notlike "*uninstall*") } | Sort-Object -Property Name
    
    Write-Output "Checking syntax of MOFS in $AutoRecoverPath"
    $c = 1
    foreach ($file in $GetAutoRecoverMOFS) {
    	$FileName = $file.Name
    	$FilePath = $file.FullName
    	Write-Output "Recompiling $FileName. $c of $($GetAutoRecoverMOFS.Count)."
    	C:\Windows\System32\wbem\mofcomp.exe -check $FilePath
    	$c++
    }
    
    Write-Output "Recompiling MOFS in $AutoRecoverPath"
    $c = 1
    foreach ($file in $GetAutoRecoverMOFS) {
    	$FileName = $file.Name
    	$FilePath = $file.FullName
    	Write-Output "Recompiling $FileName. $c of $($GetAutoRecoverMOFS.Count)."
    	C:\Windows\System32\wbem\mofcomp.exe -autorecover $FilePath
    	$c++
    }




    • Proposed as answer by ScottMetzel Thursday, August 25, 2016 5:54 PM
    • Edited by ScottMetzel Thursday, August 25, 2016 5:56 PM
    Monday, August 22, 2016 7:58 PM
  • Can you please explain line 3?

    an example would be great.

    Thanks

    Sunday, March 12, 2017 8:56 PM
  • Can you please explain line 3?

    an example would be great.

    Thanks

    Sure. Line 3 gets all .mof & .mfl files in %windir%\System32\wbem\AutoRecover\ where the file name does not include the word "uninstall", and sorts those results by the (file) name property.

    I should mention that doing any of this should be an absolute last ditch effort to resolve anything WMI-related, and to date I've only had to do this once. Typically, doing anything like this is unnecessary and probably isn't the root cause.

    Tuesday, March 14, 2017 2:02 AM
  • Thank you for this.  Saved me a lot of time.
    Monday, July 10, 2017 10:33 PM