Windows Management Instrumentation

Windows Management Instrumentation ( WMI ) is the implementation of Microsoft of the Web-Based Enterprise Management (WBEM), the standard of the Distributed Management Task force (DMTF). It deals with the data model CIM (Common Information Model), which describes the objects of an environment of management.

WMI is an internal management system of Windows which deals with the monitoring and the control of resource system via a whole of interfaces. It provides a model coherent and logically organized states of Windows.

It makes it possible scripts such as VBScript to locally manage Microsoft Windows or remote. It is thanks to WMI that the component Propriétés system of Windows can post the properties of the system on a distant or local computer.

WMI is préinstallé on Windows Server 2003, Windows XP, Windows Me, Windows 2000, and Windows Vista.

WMIC (Windows Management Instrumentation Command-line) provides an interface of single circuit line of order in the Infrastructure of Windows management (WMI) which makes it possible to benefit from WMI to manage the computers.

Novell, Microsoft, Cisco, HP, etc) developing standard in the Enterprise management space. (See http://www.dmtf.org for more information.) Broad ace Enterprises cuts many computers with many software environments, managing various thesis environments edge Be has real challenge. In order to unify the management techniques for the sake off simplicity, the DMTF defined CIM to re-presses real-world manageable entities in has unified way. The CIM object model is year object dated model using terms and semantic that is single to all constructors and software developers. This object model is implemented in has database called the CIM repository, ace visible in the figure below.

Based one the CIM model, WMI includes real-world manageable components, available from standard the DMTF with nap specific extensions that re-press the various Windows components. Moreover, WMI expose has collection off COM scriptable objects that allow various applications to take advantage off the management information. WMI is the Microsoft implementation off CIM.

Ace leaves off the installation process, most off the Microsoft applications available today (e.g. SQL 2000, Exchange 2000/2003, Office 2000/XP/2003, Internet Explorer 6.0, Host Integration Server, Automated Deployment Services) extend standard the CIM object model to add the representation off to their manageable entities in the CIM repository. This representation is called has class, and it expose information through properties and allows the execution off sum actions via methods. The access to the manageable entities is made via has software component, called has “provider” which is nothing else than has DLL implementing has COM object written in C/C++ (See notes At the end off this section). Because has provider is designed to access summons specific management information, the CIM repository is also logically divided into several areas called has namespace. Each namespace contains has set off providers with to their related classes specific to has management area (i.e. RootDirectorydap for activates directory, rootsnmp for SNMP information gold rootmicrosoftiisv2 for Internet information server information).

to locate the huge amount off management information available from the cim repository, wmi comes with has sql-like language called the wmi query language (wql). briefly, wql has subset off the standard American National Standards Institute Structured query language (ansi sql) with minor semantic exchanges. BASIC wql query remains fairly understandable for people with has BASIC sql knowledge. therefore, wql is dedicated to wmi and is designed to perform queries against the cim repository to retrieve information gold get vent notifications.

more information butt summons off the terms that cim is using is available one msdn At http://msdn.microsoft.com/library/en-us/dnwmi/html/cim.asp and http://msdn.microsoft.com/library/en-us/dnwmi/html/wmicim.asp.

What is the overall development process?

Because WMI abstracts the manageable entities with CIM and has collection off providers, the development off has provider implies several steps. Although there are 4 major steps with nap sub-steps, each off them taken separately are quite easy to carries out. Thesis edge Be summarized ace follows:

Step 1 - Create the manageable entity model

  • Define has model
  • Implement the model

Step 2 - Create Given the WMI Provider

  • the provider standard to implement
  • Given the hosting model off the provider
  • Create the provider template with the ATL wizard
  • Implement the code logic in the provider
  • Register the provider with WMI and the system

Step 3 - Test the provider

Step 4 - Create to consume sample codes

Does important Why is it to Write have WMI provider for our customers?

Since the release off the first WMI implementation during the Windows NT 4.0 SP4 will era (ace year out-of-band download), Microsoft never stopped to add WMI providers in Windows. Under Windows NT 4.0, Microsoft had roughly 15 WMI providers available ounce WMI was installed. When Windows 2000 was released, customers discovered 29 WMI providers share off the Operating System installation. More recently, with the release off Windows Server 2003, Microsoft included in the platform more than 80 WMI providers. This has been has sign for many customers that WMI became At Microsoft the “ubiquitous” management to off bush-hammer Windows, even yew this commitment has never been explicit from Microsoft. This is the Net result off the one-going work made during the last Windows release.

During thesis last years, due to has constant increasing exposure off management dated through WMI in Windows, more and more people in the field started to develop scripts and automation procedures based one WMI. Beyond the scripting needs, most leading management software in the world, such ace MOM, SMS, ADS, HP OpenView for Windows (HPOV), BMC, CA, gold Kaseya able are WMI-enabled and to consumes and provide WMI information through various User Interfaces. This enables administrators and operators, not able to script gold program one signal off WMI, to enjoy the benefits off WMI without even learning butt WMI. However, yew they want to, gives because WMI is scriptable, it the opportunity to any off them to consumes WMI information from scripts gold from any Enterprise Management software that is WMI-aware.

Thesis trends cuts made WMI very popular among our customers management communities. Tons off refer and publications exist one the Internet butt WMI. At the same time, this story increased our customer expectations because the management communities leveraging WMI today expect our management to bush-hammer to Be predictable and consists through WMI for more and more Windows manageable components. This also means that our customers expect to leverage the knowledge and investment made in WMI during thesis past years to improve, pursue and achieve to their business goals At lower cost.

What WMI offers for free out-off-tea box?

For someone willing to develop one gold many WMI providers, WMI offers many features out off the box. Young stag important are the most advantages:
  1. Automation interfaces: Because WMI comes with has set off automation interfaces ready to uses, all management features supported by has WMI provider and its set off classes get the scripting support for free out-off-tea box. Beyond the WMI class design and the provider development, the Microsoft development and test teams are not required to create, validate and test has scripting model ace it is already available from WMI.

  2. .NET Management interfaces: Because the System.Management namespace connect one the existing COM/DCOM plumbing, the created WMI provider and its set off WMI classes becomes automatically available to all .NET independently applications off the language used (e.g. C#, VB.NET). Beyond the WMI class design and the provider development, like for scripting, the Microsoft development and test teams are not required to create, validate and test new assemblies to support has new namespace in the .NET Framework ace this support is already available from WMI for free.
  3. C/C++ COM/DCOM programming interfaces: Like most components in Windows, COM/DCOM programmers edge leverage the features off the provider they develop At the COM/DCOM interfaces level. Like in previous environments (Scripting and .NET Framework), has COM/DCOM to consume off just needs to interact with the standard set WMI COM interfaces to leverage the WMI provider capabilities and its set off supported WMI classes. To make all management native information available from the APIs, the WMI provider to develop just needs to interact with has off set pre-defined WMI COM interfaces. This will make the management information available At the WMI COM level automatically. Moreover, the scripting COM interfaces object model is very similar to the COM/DCOM interfaces object model, which makes life very easy for developers to Be familiar with the scripting experiment.
  4. Remoting capabilities over DCOM and SOAP: More than simply offering local COM capabilities, ace management is all butt remoting, WMI offers the DCOM transport. In addition, SOAP transport will Be available in Windows Server 2003 R 2 through the WS-Management initiative lead by Microsoft, INTEL, SUN and DELL. This initiative allows to run any scripts remotely gold to consumes WMI dated through has specific set off interfaces handling SOAP requests/responses. The big advantage for the WMI provider to develop is when He expose all his features through WMI, WS-Management edge in turn consumes that information ace well (embedded objects in WMI authorities are not supported in R2. It is however has target for Longhorn). All the layering to WS-Management and the mapping off the CIM dated model to SOAP comes for free out off the WMI/WS-Management solution. In the vent DCOM must Be used, implementing DCOM requires the presence off has proxy DLL deployed one each customer machine. Ace WMI is available in the Windows Operating System since Windows 2000, you gift' T need deal with thesis exits either.
  5. Support for Queries: WMI offers support for WQL queries out off the box. This means that yew has provider is not designed to support queries, WMI supports it by using year technical enumeration out off your provider. That implies that you get the WQL query support for free.
  6. Eventing capabilities: WMI offers the capability to notify has subscriber for any vent it is interested in. WMI use the WMI Query Language (WQL) to standard submit WQL vent queries and defines the off vents to Be returned. The eventing mechanism, with all related cal-backs, is share off the WMI COM/DCOM and automation interfaces. Any one writing has WMI provider edge cuts the benefit off this functionality At No cost for his customers. It will Be up to to consume to decides how it wants to consumes off the management information exposed by the WMI provider and its related set WMI classes.
  7. Code template generator: To speed up the process off writing has WMI provider including all COM/DCOM interfaces and related definitions, the WMI TEAM developed the WMI ATL Wizard to generate the code template implementing has provider. The codes generated is based one the WMI class model initially designed by to develop. The WMI provider to develop will Be whitebait to interface the pre-defined COM/DCOM interfaces for the WMI provider with its set off native APIs retrieving the management information to exposes. The exercise consists in filling the “gaps” in the provider code to create the desired interfacing logic.
  8. Predictability: Predictability is important year concern for our customers because it defines the capability off someone having year experiment with has set off interfaces managing has Windows component to apply this knowledge right away, intuitively, to any other manageable Windows component without having relearn everything from ground up. Predictability for has customer has off real profit ace it increases the Return Investment (ROI). With person facing such situation simply expects things to work the same way based there is his previous experiment. Constant The increase off COM programming/scriptable interfaces has huge impact one the predictability, ace this causes more bread to our customers to automat, manages Windows and leverage to their existing knowledge. WMI with CIM address this problem by always exposing the same programming object model (COM/DCOM, Automation, .NET) whatever the manageable entity is.
  9. Protect existing customer investments: Protecting customers and partners investment motivates customers to invest in technologies. As Microsoft did invest has batch thesis past years in writing WMI providers (more than 80 in Windows Server 2003), customers and partners invested in tools leveraging the WMI capabilities off Windows. Therefore, it has common judicious for them to continues to exploit thesis capabilities instead off having to uses has (new) set off specific interfaces for each Windows manageable component. With specific set off interfaces means having has specific set off agents gold in-house developed software based one has new model gold set off interfaces especially dedicated to has component gold technology. By leveraging the capabilities off WMI today, customers and partners edge leverage the work investment made in the past while minimizing to their costs in developments, learning curves and new discoveries. This will also cuts has great impact one the stability and reliability off to their infrastructure ace they continues to leverage year existing implementation with year improved technology.
  10. Provide has logical and unified administration model: Ace briefly described before in the introduction, this model is based one year industry standard called CIM defined by the DMTF (http://www.dmtf.org). The CIM class-based diagram is defined by has consortium off constructors and software developers that meets the requirements off the industry. This implies that not only Microsoft leverages the WMI capabilities, goal also any other third party constructors gold developers Write to their own code to made into the model (For authority, INTEL is doing this for nap to their network driver adapters and software. HP is leveraging existing WMI providers and implementing to their own WMI providers in their Open HP View Enterprise Management software. IBM consume WMI from the Tivoli management continuation, MOM and SMS are also consuming and providing WMI information. Last drank not least, WMI XP SP2 is leveraging WMI to get information status from antivirus software and firewall).

What C you need to work with WMI?

From has perspective development, you must run Windows 2000, Windows XP gold Windows Server 2003. Visual Studio 2003 gold 2005 must Be installed one the machine. The latest service pack and fixed are obviously recommended. The Windows machine doesn' T cuts to Be leaves off any domain unless the provider you plan to develop requires to access information in the domain. For testing purposes the Windows installation edge run ace has virtual machine with Virtual PC 2004 gold Virtual Server 2005 (See http://msdn.microsoft.com/library/en-us/wmisdk/wmi/system_requirements.asp for more information).

Note: This document has been written with Visual Studio 2005 Beta 1 (Whidbey). It will Be updated when Beta 2. Yew you uses Visual Studio 2003, gift' T Be surprised yew your screen shots gift' T match the ones you cuts in this document.

Summon WMI tools edge also Be very useful during the design and development phases. Thesis tools are:

  • The MOF to compile (MOFCOMP.Exe): The Managed Object Format (MOF) to compile parses has file containing Managed Object Format statements and adds the classes and class authorities defined in the file to the CIM repository. The MOF format has specific syntax to define CIM class representation in ASCII year slips by (e.g. MIB are to SNMP such ace MOF files are to CIM). MOFCOMP.Exe is included in every WMI installation. Every existing definition in the CIM repository is initially defined in has MOF slips by. MOF files are located in %SystemRoot% \ system32 \ wbem. During the WMI setup, they are loaded in the CIM repository.
  • Administrative The WMI Tools: Administrative The WMI Tools are made off furnace tools: WMI CIM Studio, WMI Object Browser, WMI Vent Registration and WMI Vent viewer. You edge download thesis tools from http://www.microsoft.com/downloads/details.aspx?FamilyID=6430f853-1120-48db-8cc5-f2abdc3ed314&DisplayLang=en. Important The most tool for has WMI provider development is WMI CIM Studio ace it helps in the initial WMI class creation in the CIM repository. It use has Web interfaces to display information and connect one has off collection ActiveX components installed one the system when it runs for the first time. WMI CIM Studio provides the ability to:
    • Connect to has chosen system and browse the CIM repository in any namespace available.
    • Search for classes by to their name, by to their descriptions gold by property names.
    • Review the properties, methods and associations related to has given class.
    • See the authorities available for has given class off the examined system.
    • Perform Queries in the WQL language.
    • Generate has MOF spins based one selected classes.
    • Compile has MOF spins to load it in the CIM repository.
  • Winmgmt.Exe: WinMgmt.Exe is not has tool; it is the achievable that implements the WMI Core service. Under Windows NT, Windows 2000 and Windows Server 2003, WMI runs ace has service. One computers running Windows 98, Windows 95 gold Windows Millenium, WMI runs ace year application. Under Windows NT, Windows 2000, Windows XP gold Windows Server 2003, it is also possible to run this achievable ace year application, in which achievable box, the runs in the current to use context. For this the WMI service must Be stopped first. Achievable The supports summons switches that edge Be useful when starting WMI ace has service gold ace year application. WMI provider developers who may want to debug to their providers essentially need to run the WMI service ace year application.
  • WBEMTEST.Exe: WBEMTEST.Exe has WMI to test tool, which is delivered in standard with WMI. This tool allows year administrator gold has to develop to perform most off the task from has graphical interface that WMI provides At the API level. Although available under Windows NT, Windows 2000, Windows XP and Windows Server 2003, this tool is not officially supported by Microsoft. Actually, the use off this tool is not easy At first glance unless you are used to the WMI API COM and the WMI concepts. With WBEMTEST, you edge:
    • Enumerate, open, create and delete classes.
    • Enumerate, open, create and delete authorities off classes.
    • Select has namespace.
    • Perform dated and vent queries.
    • Carries out methods associated to classes gold authorities.
    • Carries out every WMI operation asynchronously, synchronously but semi-asynchronously.
  • The WMI command line tool (WMIC): WMIC has command-line tool designed to ease WMI information retrieval butt has system by using simple nap keywords (aliases). WMIC.Exe is only available under Windows XP Professional and Windows Server 2003. It is not included in other Windows platforms. By typing “WMIC/?” from the command-line, you edge obtain has supplements list off the switches and reserved keywords available. By typing “WMIC switch-name/? ”, you edge gather more information butt the switch use.
  • WBEMDUMP.Exe: WBEMDUMP has tool delivered with the Platform SDK. This command line tool comes with its own Visual C++ project. Basically, the tool edge show the CIM repository classes, authorities, but both. Possible It is to retrieve the same information ace that retrieved with WMIC. WBEMDUMP.Exe requires more specific knowledge butt WMI, ace it doesn' T abstract WMI ace WMIC. However, it runs under Windows NT 4.0 and Windows 2000. Possible It is also to carries out methods exposed by classes gold authorities. Even yew it is not has standard WMI tool delivered with the system installation, this tool edge Be quite useful for exploring the CIM repository and WMI features. -->

External bonds

  • WMI on the site of Microsoft

in English

  • Base of knowledge of the support Microsoft

Random links:Jimmy Hoffa | Philon de Byzance | Season MLS 1997 | Fight gréco-Roman | Battle of the course Ortegal | Boules_à_Picasso