Recent Posts

Tags

News

Community

Email Notifications

Conference Presentations

Affiliations

Articles Published

My Personal Links

Archives

Duncan McAlynn Microsoft System Center

Resourcefulness is the great divider between excellence and mediocrity.

How Do I Rebuilt a Corrupt WMI Repository?

The following can be done through a batch file or executed manually from the command line:
 
net stop winmgmt
c:
cd %systemroot%\system32\wbem
rd /S /Q repository
 

regsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\system32\userenv.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
echo DONE reboot
pause

Comments

lduncan said:

Your script saved me. Thanks...!!!
# December 3, 2004 12:49 AM

lduncan said:

Here's a link to a MSDN Library discussion of the topic:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/reinstalling_wmi.asp

Anyone see pro's or con's of this approach vs. the script posted?
# December 7, 2004 12:14 PM

lduncan said:

I ran the above and after entering "mofcomp cimwin32.mof script" received the following message
MOF file has been successfully parsed
Storing Data in the Repository
An error occured while opening the namespace for object 1 defined on lines 8 -11:
Error Number 0x8007042c, Facility: Win 32
Description: The dependency service or group failed to start
Compiler returned error 0x8007042c
Your help would be greatly appreciated.
# February 5, 2005 5:45 AM

lduncan said:

similar as above except:

An error occurred while opening the namespace for object 1 defined on lines 8 -
11:
0X80041002 Class, instance, or property '' was not found.
Compiler returned error 0x80041002



i'll probably have to do a repair install then
# February 11, 2005 7:24 PM

lduncan said:

Ran this on a PC experiencing a problem...

It fixed my original issue, however it unmapped all network printers...
Reboot = Same Problem
# February 20, 2005 11:26 PM

lduncan said:

I had the same issue and looked everywhere for a resolution. Ive found two issues. The event log service is not running. Once turned on WMI runs. If event log wont run a repair or reinstall is necessary. If event log is running the fix is rather simple. First be sure the windows management service is stopped. Open the command prompt and navigate to %systemroot%\system32\wbem\repository. Once in this folder del *.* and del FS. After a reboot the windows management is forced to create a new database clearing out the error.
# March 15, 2005 7:15 PM

lduncan said:

Great solution. Thanks......!!!
# March 29, 2005 10:04 AM

lduncan said:

is this what i suppost to type? for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s
what the % means?
# April 1, 2005 11:16 PM

lduncan said:

I get tons of errors like this while running mofcomp on any mof/mfl.

C:\WINDOWS\system32\wbem>mofcomp wmitimep.mfl
Microsoft (R) 32-bit MOF Compiler Version 5.1.2600.2180
Copyright (c) Microsoft Corp. 1997-2001. All rights reserved.
Parsing MOF file: wmitimep.mfl
MOF file has been successfully parsed
Storing data in the repository...
An error occurred while opening the namespace for object 1 defined on lines 4 - 4:
Error Number: 0x80070005, Facility: Win32
Description: Access is denied.
Compiler returned error 0x80070005

Any ideas?
# April 26, 2005 3:42 PM

lduncan said:

I followed the steps given in Microsoft's link to reinstall WMI, i.e. delete the repository and then restart the Winmgmt service. But it is not reproducing all the classes. All the performance related classes are missing. i.e. which starts with win32_perf.....

Could somebody help me out. These classes where present in the original repository, as I had saved a dummy copy of the old repository in the other drive

Thanks!!!
# May 26, 2005 10:18 PM

lduncan said:

Greate it helped me too thanks a lot
# June 8, 2005 4:31 AM

lduncan said:

This works great!! Just a comment to be patient when the wbem dlls are reregistering... some of them take a LONG LONG Time.
# July 11, 2005 4:59 PM

WMI has stopped working on some remote computers. | wisefaq.com said:

Pingback from  WMI has stopped working on some remote computers. | wisefaq.com

# April 28, 2010 6:49 AM

Getting error “WMI: Not Found” on a Windows 2003 Server Drija said:

Pingback from  Getting error “WMI: Not Found” on a Windows 2003 Server Drija

# November 16, 2010 1:44 PM

Error 25205.Failed to uninstall SDK MOF. Error Code: -2147217406 (IDispatch error #3586). « Sergei Jemeljanov's said:

Pingback from  Error 25205.Failed to uninstall SDK MOF. Error Code: -2147217406 (IDispatch error #3586). « Sergei Jemeljanov's

# November 24, 2010 9:46 AM

Getting error “WMI: Not Found” on a Windows 2003 Server Drija said:

Pingback from  Getting error “WMI: Not Found” on a Windows 2003 Server Drija

# April 24, 2011 10:13 AM

Fehler “0×80041002 bei Service Pack 1 (SP1) Installation ?? Anleitungen, Code, Error, Fehler, Installation, SP1, Tipp, Trick, WMI ?? Windows FAQ said:

Pingback from  Fehler “0×80041002 bei Service Pack 1 (SP1) Installation ?? Anleitungen, Code, Error, Fehler, Installation, SP1, Tipp, Trick, WMI ?? Windows FAQ

# February 6, 2012 12:26 PM

Error 0×80041002 | Self-Indulgent said:

Pingback from  Error 0×80041002 | Self-Indulgent

# February 20, 2012 7:16 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

If you can't read this number refresh your screen
Enter the numbers above: