WMI Repository Corruption / SCCM Client Fix

You may have come across the following messages in the execmgr.log file on your SCCM clients:

Failed to open to WMI namespace '.rootccmPolicyMachine' (8007045b)
Failed to ConnectSettings for ICcmPolicyAgent in CSoftDistPolicyNamespace::ConnectToNamespace
Failed to ConnectToNamespace in CSoftDistPolicyNamespace::GetMachinePolicy
Failed to connect to machine policy name space. 0x8007045b
Failed to connect to user policy name space
CSoftwareDistPolicyMgr::GetSWDistSiteSettings failed to connect to machine namespace
Failed to instantiate UI Server {C2F23AE4-82D8-456F-A4AF-A2655D8CA726} with error 8000401a
Failed to instantiate UI Server 2 {E8425D59-451B-4978-A2AB-641470EB7C02} with error 8000401a
Failed to instantiate Updates UI Server {2D023958-73D0-4542-8AD6-9A507364F70E} with error 8000401a
Failed to instantiate VApp UI Server {00AAB372-0D6D-4976-B5F5-9BC7605E30BB} with error 0x8000401A

These messages are the result of WMI repository corruption. Other sources online have suggested:

1. Stopping the SMS Agent Host service (net stop ccmexec)
2. Stopping the WMI service (net stop winmgmt)
3. Deleting the WMI repository (rmdir /s /q %WINDIR%System32wbemrepository)
4. Starting the WMI service (net start winmgmt)
5. Starting the SMS Agent Host service (net start ccmexec)

Advertisement: Please take a moment to check out Arvixe PersonalClassASP web hosting!

This may work, however I have noticed other people in the past suggest that deleting the WMI repository is not ideal, even though it may work. Why exactly that is, I can’t necessarily explain off the top of my head. Either way, I recently encountered a client that was experiencing these errors, and instead of doing the usual WMI repository deletion, I instsead simply ran “winmgmt /resetrepository”. From the description of the command in the help, it would seem that it does more or less the same thing as deleting the repository, although this seems like a “cleaner” way of handling it. After all, the command was written and distributed by Microsoft, so I’m more apt to trust this method. The command help reads:

/resetrepository
The repository is reset to the initial state when the operating system
is first installed. MOF files that contain the #pragma autorecover
preprocessor statement are restored to the repository.

From what I can tell, running this command on the problem client has resolved whatever issues were present. Manually firing off an advertisement worked just fine, and the execmgr.log did not reproduce these messages (yet).

20 thoughts on “WMI Repository Corruption / SCCM Client Fix

  1. Pingback: WMI Repository Corruption / SCCM Client Fix « Trevor Sullivan's Tech Room - Rod Trent at myITforum.com

  2. This is a great find. What Operating Systems are you using this on? I was looking into this comment more and found this on MSDN.

    /resetrepository The repository is reset to the initial state when the operating system is first installed. MOF files that contain the #pragma autorecover preprocessor statement are restored to the repository.
    Windows Server 2003, Windows XP, and Windows 2000: This switch is not available.

    http://msdn.microsoft.com/en-us/library/aa394525(VS.85).aspx

    Looks like it is not available for 2000, XP, and Server 03.

    • Brian,

      I ran the command on an XP machine after finding the switch on my Windows 7 system. I thought I had seen the /resetrepository switch on XP before, but I guess I was wrong. Either way, this did seem to resolve the issue I was having with a particular SCCM client when I wrote the blog entry the other day. The command runs, but returns no output, so there’s no indication of it being an invalid parameter on XP.

      If you find anything else out, please let me know.

      -Trevor

  3. Running that command/parameter seems to have fixed whatever issue was creating these entries in the Update Deployment log – thanks!

    CTargetedUpdate::Save – Failed to open \.rootCCMSoftwareUpdatesDeploymentAgent namespace, error 8007045b UpdatesDeploymentAgent 12/3/2009 1:06:21 PM 3356 (0x0D1C)
    Failed to resolve time properties on system time change, error = 0x8007045b UpdatesDeploymentAgent 12/3/2009 1:06:21 PM 3356 (0x0D1C)
    Failed to open to WMI namespace ‘\.rootccmPolicyMachine’ (8007045b) UpdatesDeploymentAgent 12/3/2009 1:06:21 PM 3356 (0x0D1C)
    CUpdatesAssignmentPolicy – spPolicyAgent->ConnectSettings failed, error 8007045b UpdatesDeploymentAgent 12/3/2009 1:06:21 PM 3356 (0x0D1C)
    Failed to load Assignment ({E5DF4D5E-6B66-4841-B07A-38731CAF2071}) during update (Site_CA7B826D-D3D9-46A6-AFB5-E68F3AEDE51A/SUM_4df9e362-290e-43a3-8fea-387632d1e2b3) properties resolution. UpdatesDeploymentAgent 12/3/2009 1:06:21 PM 3356 (0x0D1C)

  4. Pingback: SCCM 2007 WMI Repository Corruption « "DZUB-NON TRUL-PAR"

  5. Windows XP has a way to fix the repository by calling a dll using rundll32
    rundll32 wbemupgd, UpgradeRepository

    And, from the top of my head, blowing away the repository is a bad idea as it could break more than you fix.
    Rebuilding the WMI repository will rebuild all items added using AUTORECOVER, all items that were added to WMI without the AUTORECOVER parameter will not be rebuild. The problem with this is that more and more applications are starting to use WMI, and most people have no clue on which apps use it, and if the classes used by their apps are registered with the AUTORECOVER parameter or not.

    In short, blowing away the repository, has a high potential for fixing your ConfigMgr client issue. It has an equally high potential to break something you weren’t aware off.

    Glad you tried to step away from the bad habit and blogged about it, even more so because it worked.

    • I have used this on multiple xp machines with configuration manager issues as a last resort. It has always worked. If it dosent work the best thing to do is reimage. So I disagree with you Kim, I have had very good luck with this.

    • Thanks for your comments Kim.

      @Theclarks1: I think Kim was agreeing with me, because the /resetrepository command-line switch does not blow away the repository, like most people manually do. I’m glad it’s working out for you!

      Cheers,
      Trevor Sullivan

  6. I gave it a try so I have my fingers crossed. Just a side note, for Win7, make sure you run it with elevated cmd prompt and you need to stop any WMI dependent services.

  7. Thank you!!! I spend a whole day troubleshooting  a SCCM 2012  client installation issue. 

    Setup was unable to compile the file SmsClient.mof

    Error Number: 0x8004100e, Facility: WMI

    Description: Invalid namespace
    Missing rootccm namespaceRunning  the command winmgmt /resetrepository fixed it! Deleting or renaming the repository didn’t work. 

  8. It’s important to understand the ramifications of deleting the wmi repository. While this may appear to solve your issue in the short term, pay attention to the warning that MOF files without an autorecover statement will not process. In English, this means any applications you’ve installed may stop working if you don’t re-register the MOF with wmi. Just a word of warning, you may fix one problem, but cause ten more.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>