How to reconstruct the WMI classes?

How to reconstruct the WMI classes?

MOF (Managed Object Format) file is the mechanism by which information about WMI classes is entered into the WMI Repository. It is possible that the class definitions currently in the Repository have somehow do not show up the values; in that case, recompiling your .MOF files will cause those class definitions to be overwritten and replaced with the same, uncorrupted class definitions used when the operating system was originally installed.

On the remote windows server stop the "Windows Management Instrumentation" service , take backup of  "C:\Windows\System32\wbem\Repository" folder (for Windows 2000 server "C:\WINNT\System32\wbem\Repository" and after running the commands, start the "Windows Management Instrumentation" service again.


Execute the following commands in the command prompt

for Windows 2013/2012/
2008/7

* c:\windows\system32\wbem\Mofcomp.exe c:\windows\system32\wbem\cimwin32.mof

* c:\windows\system32\wbem\Mofcomp.exe c:\windows\system32\wbem\en-US\cimwin32.mfl

Note: en-US is the "locale-Country" of the language in the Windows OS is installed.

for Windows 2003/XP

*  wmiadap /f

* c:\windows\system32\wbem\Mofcomp.exe c:\windows\system32\wbem\cimwin32.mof

* c:\windows\system32\wbem\Mofcomp.exe c:\windows\system32\wbem\cimwin32.mfl

for Windows 2000

* winmgmt /resyncperf

* c:\winnt\system32\wbem\Mofcomp.exe c:\winnt\system32\wbem\cimwin32.mof

* c:\winnt\system32\wbem\Mofcomp.exe c:\winnt\system32\wbem\cimwin32.mfl

If you get a path not found error, replace windows (in case of Windows 2003/XP/2008) or winnt(in case of windows 2000) with your %windir% (Windows Directory name)

This will reconstruct all the perfom WMI classes.Also refer the following link for more details.

http://www.microsoft.com/technet/scriptcenter/topics/help/wmi.mspx#ECIAC



          • Related Articles

          • How can I reconstruct the WMI classes?

            Managed Object Format (MOF) file is the mechanism by which information about WMI classes is entered into the WMI Repository. It is possible that the class definitions currently in the Repository somehow do not show up the values. In this case, ...
          • Setting WMI access through Active Directory and Group Policy Object

            In our case, we run Active Directory on Windows 2008 R2 and we want to scan the target machine which is Windows 2012 R2 machine. Our domain is called “APMCLU” and we name our dedicated WMI user-account “wmiuser”. First – Setting done from Active ...
          • Configuring non-admin user account for WMI monitoring

            QUESTION: How to set up WMI monitoring without domain admin or local admin credentials   RESOLUTION: Windows will only allow members of the Administrators or Domain Admin groups to read WMI class information by default. However, you can configure a ...
          • Getting 'Invalid WMI query' with error code 0x80041017 in Windows

            "Invalid WMI query" with error code WBEM_E_INVALID_QUERY (0x80041017) found in log files or script execution when collecting Windows performance counter data. It is possible that the Win32_PerfRawData_PerfOS_Processor cannot be found or accessed on ...
          • Steps to verify WMI access for Non-Admin Domain user

            This guide provides how to enable and test WMI access with a regular domain user without generic admin rights. Make sure you have followed the steps in the article Setting WMI access through Active Directory & Group Policy Object. This ensures you ...