Windows Management Instrumentation (WMI) consists of a set of extensions to the Windows Driver Model that provides an operating system interface through which instrumented components provide information and notification. WMI is Microsoft's implementation of the Web-Based Enterprise Management (WBEM) and Common Information Model (CIM) standards from the Distributed Management Task Force (DMTF).
Original author(s) | Microsoft |
---|---|
Developer(s) | Microsoft |
Operating system | Microsoft Windows |
Platform | IA-32, x86-64, and ARM (historically Itanium, DEC Alpha, MIPS, and PowerPC) |
Type | Systems management |
License | Proprietary |
Website | docs |
WMI allows scripting languages (such as VBScript or Windows PowerShell) to manage Microsoft Windows personal computers and servers, both locally and remotely. WMI comes preinstalled in Windows 2000 and in newer Microsoft OSes. It is available as a download for Windows NT and[1] Windows 95 to Windows 98.[2]
Microsoft also provides a command-line interface to WMI called Windows Management Instrumentation Command-line (WMIC).[3]
The purpose of WMI is to define a proprietary set of environment-independent specifications which allow management information to be shared between management applications. WMI prescribes enterprise management standards and related technologies for Windows that work with existing management standards, such as Desktop Management Interface (DMI) and SNMP. WMI complements these other standards by providing a uniform model. This model represents the managed environment through which management data from any source can be accessed in a common way.
Because WMI abstracts the manageable entities with CIM and a collection of providers, the development of a provider implies several steps. The major steps can be summarized as follows:
Since the release of the first WMI implementation during the Windows NT 4.0 SP4 era (as an out-of-band download), Microsoft has consistently added WMI providers to Windows:
Many customers[which?] have interpreted the growth in numbers of providers as a sign that WMI has become at Microsoft the "ubiquitous" management layer of Windows, even if Microsoft has never made this commitment explicit.
Because of a constant increasing exposure of management data through WMI in Windows, people in the IT systems management field started to develop scripts and automation procedures based on WMI.[citation needed] Beyond the scripting needs, most leading management-software packages, such as MOM, SCCM, ADS, HP OpenView for Windows (HPOV), BMC Software or CA, Inc. are WMI-enabled and capable of consuming and providing WMI information through various User Interfaces. This enables administrators and operators not capable of scripting or programming on top of WMI to enjoy the benefits of WMI without even learning about it. However, if they want to, because WMI is scriptable, it gives them the opportunity to consume WMI information from scripts or from any WMI-aware enterprise-management software.
For someone willing to develop one or many WMI providers, WMI offers many features out of the box. Here are the most important advantages:
Some WMI tools can also be useful during the design and development phases. These tools are:
Developer(s) | Microsoft |
---|---|
Operating system | Microsoft Windows |
Type | Command |
License | Proprietary commercial software |
Website | docs |
In the .NET Framework, the ManagementClass class represents a Common Information Model (CIM) management class. A WMI class can be a Win32_LogicalDisk in the case of a disk drive, or a Win32_Process, such as a running program like Notepad.exe.
This example shows how "MSNdis_80211_ServiceSetIdentifier" WMI class is used to find the SSID of the Wi-Fi network that the system is currently connected to in the language C#:
ManagementClass mc = new ManagementClass("root\\WMI", "MSNdis_80211_ServiceSetIdentifier", null);
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
string wlanCard = (string)mo["InstanceName"];
bool active;
if (!bool.TryParse((string)mo["Active"], out active))
{
active = false;
}
byte[] ssid = (byte[])mo["Ndis80211SsId"];
}
The "MSNdis_80211_ServiceSetIdentifier" WMI class is only supported on Windows XP and Windows Server 2003.
The WMI extensions to WDM provide kernel-level instrumentation such as publishing information, configuring device settings, supplying event notification from device drivers and allowing administrators to set data security through a WMI provider known as the WDM provider. The extensions are part of the WDM architecture; however, they have broad utility and can be used with other types of drivers as well (such as SCSI and NDIS). The WMI Driver Extensions service monitors all drivers and event trace providers that are configured to publish WMI or event trace information. Instrumented hardware data is provided by way of drivers instrumented for WMI extensions for WDM. WMI extensions for WDM provide a set of Windows device driver interfaces for instrumenting data within the driver models native to Windows, so OEMs and IHVs can easily extend the instrumented data set and add value to a hardware/software solution. The WMI Driver Extensions, however, are not supported by Windows Vista and later operating systems.[10]