Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a non-jargon definition for WMI?

I have been reading a bit about WMI, and trying to get a handle on what it is, but it all seems like a lot of jargon and circular definitions.

Here: Windows Management Instrumentation (WMI) is the infrastructure for management data and operations on Windows-based operating systems.

An "infrastructure"? Huh?

Is it just some hooks into the operating system for accessing system resources, devices? What? If so, what is it made of? Are these COM classes?

WHAT IS WMI?

like image 418
richard Avatar asked May 26 '11 20:05

richard


People also ask

What does WMI stand for?

Windows Management Instrumentation (WMI) is the infrastructure for management data and operations on Windows-based operating systems.

What is WMI and how it works?

Windows Management Instrumentation (WMI) is a subsystem of PowerShell that gives admins access to powerful system monitoring tools. Though this system has been designed to allow for fast, efficient system administration, it also has a spookier side: it can be abused by insiders as a tool to surveil other employees.

What is a WMI object?

WMI – Windows Management Instrumentation. It is the Microsoft implementation of Web-Based Enterprise Management (WBEM) allowing access to data. WMI uses the Common Information Model (CIM) to describe objects such as systems, applications, network equipments,… CIM – Common Information Model.

What protocol does WMI use?

The WMI standard uses a web-based approach for exchanging data across platforms. Data is encoded using Extensible Markup Language (XML) and transmitted between the WMI repository and clients using the Hypertext Transfer Protocol (HTTP).


2 Answers

Overview

Well, WMI is a system that allows querying information about a machine. WMI is made up of many different providers and classes, and each class can have properties and methods on it, not so much unlike .NET. Providers are responsible from returning classes.

You can query WMI either locally, or remotely. That's why it's considered a management infrastructure. An IT staff can use WMI to get information and perform actions with WMI remotely. For example, if you wanted to know what kind of drives was on the machine, you could run a WQL query like this:

SELECT * FROM Win32_DiskDrive

That would return a collection of Win32_DiskDrive and tell you information about it. Since they are objects, they have methods on them too.

Sometimes, WMI can tell you information about an environment that you can't get that information elsewhere, like when using Win32_Mainboard to get information about the motherboard.

3rd party developers might write their own WMI providers and classes to allow their application to be managed using WMI, something an IT person is likely already familiar with and they don't want to reinvent the wheel.

Details

A Provider is a COM Object that acts between WMI and a management object/class. Classes are defined in the MOF (Managed Object Format). So the underlying thing is a provider is registered as a handler for the class, and when information from that class is asked for, the provider is fired up. Like .NET, management objects are scoped and defined in namespaces. The bulk of Microsoft's are in \ROOT\cimv2.

The provider will implement the interfaces IWbemProviderInit and IWbemProviderInitSink. There is some good details on that here

Since it is a COM object, it is possible to write a WMI Provider in .NET and use ComVisible to expose the provider.

Once you've developed it, you need to register it. You might also consider registering it before development it to aide debugging.

Microsoft has a simple example at http://msdn.microsoft.com/en-us/library/aa393677(v=vs.85).aspx.

like image 108
vcsjones Avatar answered Sep 20 '22 15:09

vcsjones


I think technet FAQ might be helpful a bit.

The word “Instrumentation” in WMI refers to the fact that WMI can get information about the internal state of computer systems, much like the dashboard instruments of cars can retrieve and display information about the state of the engine. WMI “instruments” by modeling objects such as disks, processes, or other objects found in Windows systems. These computer system objects are modeled using classes such as Win32_LogicalDisk or Win32_Process; as you might expect, the Win32_LogicalDisk class models the logical disks installed on a computer, and the Win32_Process class models any processes currently running on a computer. Classes are based on the extensible schema called the Common Information Model (CIM). The CIM schema is a public standard of the Distributed Management Task Force (http://www.dmtf.org).

It's just the kind of progrmming interface allowing you to get system info. Here you can take a look at it's architecture, it might answer some of your questions.

like image 28
Silx Avatar answered Sep 20 '22 15:09

Silx