Advertisment

Understanding WMI

author-image
PCQ Bureau
New Update

WMI (Windows Management Instrumentation) has been around for years and we have carried umpteen articles on how it can be harnessed. So what is WMI? WMI derives from a much larger industry standard known as WBEM (Web-Based Enterprise Management). It refers to the ability to manage your enterprise infrastructure from a simple Web browser. This in itself, is abstracted through yet another specification called CIM (Common Information Management). Yes, CIMOM (CIM Object Manager) is a Microsoft-specific implementation of this. This series seeks to explore and expose the mystery of WMI, which can be best understood by going through the inner workings of Windows.

Advertisment

Intra-OS communications



If software as large as an OS needs to pass messages (exchange values, call functions and so forth) between its various components, its developers would rather write API (Application Programming Interface) logic rather than code them. Why? Because software grows and changes. If everything were hard coded, and something changed somewhere along the way, developers would have had to spend a long time tracking it down and change a lot of code. When you write API logic into software, it is all generalized, centralized and standardized. As a result, tracking things down and modifying them becomes a lot easier.

Direct Hit!
Applies to: Windows programmers
USP: WMI is a long-existing technology native to Windows. We explain what it is all about and how to use it in this multi-part series
Links:

http://msdn.microsoft.com/library/enus/wmisdk/



wmi/wmi_start_page.asp
 

Early software used an archaic form of this called signaling and semaphores. These roughly resemble railway-signaling systems. When a piece of code had something to tell another piece, it puts up its hand and grabs attention. Today, such a thing would not be effective since software often resides on multiple machines and even spans the Internet. This is what makes API better than semaphores.

Advertisment

But then, APIs can be very quirky. There can be a load of libraries in a system, of different versions and supporting different forms of the same API. Over time, it has become very bulky. With the adoption of WBEM at the OS level, all these messages become easily accessible across physical computer systems, sometimes spanning entire networks. WMI enables Windows developers to query, modify and use this information transparently and painlessly.

Transient data storage



Transient data refers to the data being used by software during its running. Gone are the days when transient data could be simply stored in memory. Today, you need this data across system restarts. If you are running a multi-server application, then you need to span and store your data across servers as well. This can be achieved using metadata and it is maintained in sync using TCP/IP transmissions. Metadata or hyper-data is the information that is transparently stored and used by the system, without user's intervention. Windows Registry is a form of metadata. When software runs, it reads, writes and queries this metadata. To make this more efficient, files holding this information are often mini databases themselves. And to support this, SQL-like syntaxes are used to interact with them. WMI supports SQL queries and provides system-independent access to the data. 

You can use WMI and other management interfaces to effectively manage systems from centralized consoles

Advertisment

WOOPS



The only thing now left is to create abstracts of the software and hardware we need to manage. This is done by objectizing the environment, by creating classes and the corresponding paraphernalia (methods, inheritances, etc). Windows, thus, becomes OOPS (hence WOOPS). There would be classes and more classes for each manageable object both within Windows as well as for everything that it can manage-the hardware, the drivers, etc. This makes it much easier to manage the various elements of Windows. That's exactly what WMI is meant to do. 

Next, we shall see how WMI uses CIM and WBEM to enable obscure components to be visible and manageable from everywhere on the Internet.

Sujay V. Sarma

Advertisment