Trevor Sullivan's Tech Room

Ramblings of an IT professional

WMI Repository Corruption / SCCM Client Fix

Posted by Trevor Sullivan on November 6, 2009

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

Failed to open to WMI namespace '\\.\root\ccm\Policy\Machine' (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%\System32\wbem\repository)
4. Starting the WMI service (net start winmgmt)
5. Starting the SMS Agent Host service (net start ccmexec)

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).

4 Responses to “WMI Repository Corruption / SCCM Client Fix”

  1. [...] WMI Repository Corruption / SCCM Client Fix « Trevor Sullivan's Tech Room Filed under: System Center, ConfigMgr 2007 [...]

  2. Brian said

    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.

    • pcgeek86 said

      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. Dave said

    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 \\.\root\CCM\SoftwareUpdates\DeploymentAgent namespace, error 8007045b UpdatesDeploymentAgent 12/3/2009 1:06:21 PM 3356 (0×0D1C)
    Failed to resolve time properties on system time change, error = 0×8007045b UpdatesDeploymentAgent 12/3/2009 1:06:21 PM 3356 (0×0D1C)
    Failed to open to WMI namespace ‘\\.\root\ccm\Policy\Machine’ (8007045b) UpdatesDeploymentAgent 12/3/2009 1:06:21 PM 3356 (0×0D1C)
    CUpdatesAssignmentPolicy – spPolicyAgent->ConnectSettings failed, error 8007045b UpdatesDeploymentAgent 12/3/2009 1:06:21 PM 3356 (0×0D1C)
    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 (0×0D1C)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>