You must have heard of WMI as a part of your everyday management and technical duties, especially when you’ve tried to get information from devices connected to your computer. But what is WMI really and why is it important for a network?
What is WMI?
Windows Management Instruments, or WMI in short, is the Microsoft version of an industry-standard called Web-Based Enterprise Management (WEBM). This standard lays down the specifications for accessing and using management information in an enterprise environment.
Specifically, it sets the rules for accessing data from non-uniform technologies through a standardized architecture.
WMI is the Microsoft implementation of this standard and in fact, it is an infrastructure that enables you to access data and information, regardless of the underlying device. In other words, this infrastructure is device-independent.
WEBM uses the Common Information Model (CIM) as its schema and since WMI is also a similar implementation, this also uses CIM as its schema. This schema is well-suited for WMI because it stores data about the environment in the form of interrelated systems, each composed of a discrete set of elements.
This way, vendors have a predefined set of values that they can build on, and this is why this schema is most ideal for managing such information.
Uses of WMI
The central role of any server is to listen to the requests coming from clients and to respond appropriately. When a client needs data or functionality from a server, it sends a request over the network.
The server, in turn, receives the request, processes it, and sends back the necessary information or error, depending on the nature of the request. The server can also do a whole lot of other related things such as verifying the authenticity of the requester, ensuring that the client has the necessary permissions, the request is in the appropriate format, and more.
All this means, the functionality to listen in to requests is the core requirement for a device to become a server. This functionality can come as a part of its operating system or it can come from an installed application. In some cases, both these sources can be combined as well.
To understand this better, let’s take two servers as examples. In the case of Microsoft Windows Server, the functionality to listen and respond to clients comes as a part of the operating system while in the case of Apache Web Server, an additional application called Apache should be installed on top of the operating system.
WMI facilitates this communication between servers and clients. In fact, WMI is most useful to get management data from remote computers because it allows connections to be made through DCOM. The most salient feature of WMI is that it provides a uniform interface for local as well as remote applications, so the scripts or applications do not have to call a lot of other APIs.
Also, management applications and scripts can be programmed to get data through WMI in many languages such as C++, C#, and more. You can even create your own WMI providers to add to the available set of management tasks.
Besides, scripting languages, you can also access WMI through its own dedicated command-line interface called WMIC. This CLI is compatible with most shells, including the standard Windows command-line. All that you have to do is type WMIC followed by the parameter.
Now that we know the uses of WMI, let’s take a look at its architecture and the different components present in it.
Here are some key components of WMI:
WMI infrastructure is a component of the Windows operating system and is called WMI Service (winmgmt). In turn, this has two core components, namely, WMI Core and WMI Repository.
The WMI infrastructure is implemented in the Windows operating system as a service. This WMI service sits between WMI providers and managing applications. It automatically starts at the time of system boot. You can stop it at any time, and it will start up again when any application or script requests for access to any WMI namespace.
WMI repository is a database for storing all static data related to WMI. Dynamic data is not stored in these repositories and the only way to retain this dynamic data is for a WMI provider to capture and retrieve it or a WMI application to log it through a WMI class.
This repository is organized as WMI namespaces. The WMI Services creates a few repositories such as root\default, root\cmiv2, and root\subscription during system startup. The remaining namespaces are created by WMI providers.
WMI providers are a COM object that monitors one or more managed objects. In other words, it collects, manages, and reads data from those managed objects that it is programmed to access. These providers can be implemented through the operating system or through programming languages such as C++ and Visual Basic, and they are accessible through the command-line interface.
There are many built-in WMI providers in Windows such as Active Directory, Boot Configuration Data, Distributed File System, and more.
The role of WMI providers is to respond to queries from management applications and programmed scripts.
Managed objects are logical and physical components that are managed through WMI. It can be a hardware or a software component, but it has to be an instance of the WMI class. Managed objects can include processors, servers, applications, operating systems, memory, network-attached equipment, and services.
WMI consumers, as the name suggests, is the application or script that interacts with the WMI infrastructure. These applications can run queries, provider methods, or even subscribe to events.
This API provides access to the WMI infrastructure for any application that wants to use WMI. The response to these APIs goes through classes, instances, and methods.
Latest version of WMI
The latest version of WMI is called Windows Management Infrastructure, or MI, in short. This latest version is fully compatible with the previous versions and comes with more features and advantages such as tighter integration with PowerShell, lower development time, and more.
Thus, these are some of the fundamental concepts of WMI. We hope they help you to better understand this architecture and appreciate its role in your client-server communication model.