Thursday, September 6, 2012

Windows Management Instrumentation (WMI)

Microsoft Systems Management Server (SMS) 2003 is a Windows-based product that you can use to manage, support, and maintain a distributed network of computer resources. SMS enhances its abilities by using Windows Management Instrumentation (WMI), which is management infrastructure that supports monitoring and controlling system resources through a common set of interfaces.
WMI is a middle-layer technology that enables standardized management of Windows-based computers. It collects computer management data from a wide variety of sources and makes it accessible by using standard interfaces. WMI can be accessed remotely, but it does not consolidate the management data in a central location - that is one of the functions of SMS. You can also use WMI to set configuration details on your computer and to detect and respond to changes in the configuration of your computer (using WMI events).
You can manage WMI by using the following tools:
  • WMI Control
  • MOF Compiler (MOFComp.exe)
  • WinMgmt.exe
MOF Files:
The Managed Object Format (MOF) file describes Common Information Model (CIM) classes; defines textual descriptions of classes that are used by a provider to return data; commonly used to change WMI settings and to transfer them between computers.
MOF files are programmed in a language derived from the Microsoft Visual C++ syntax. The contents of MOF files only become effective when the files are compiled. They can can be compiled into the WMI repository using the program Mofcomp.exe. They typically are bundled with a corresponding .DLL file, which contains the skeleton code that returns the data defined in the MOF file.
The MOF file format and compiler were developed by the Desktop Management Task Force (DMTF).

MOF Compiler (MOFComp.exe):
MOF files are usually automatically compiled during the installation of the systems with which they are provided, but you can also compile MOF files by using the MOF Compiler (Mofcomp.exe). The MOF Compiler is available in the %Windir%\System32\wbem directory. You must specify the MOF file as the parameter of the MOF Compiler. The MOF compiler parses a file containing MOF statements and adds the classes and class instances defined in the file to the WMI repository. You can also specify an Autorecover switch if you want the MOF file to be automatically recompiled if the CIM Repository ever has to be automatically recovered.