Windows Management Instrumentation (WMI) is a set of extensions to the
Windows Driver Model
In computing, the Windows Driver Model (WDM) also known at one point as the Win32 Driver Model is a framework for device drivers that was introduced with Windows 98 and Windows 2000 to replace VxD, which was used on older versions of Windows su ...
that provides an
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
interface through which
instrumented components provide information and notification. WMI is
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
's implementation of the
Web-Based Enterprise Management (WBEM) and
Common Information Model (CIM) standards from the
Distributed Management Task Force
Distributed Management Task Force (DMTF) is a 501(c)(6) nonprofit industry standards organization that creates open manageability standards spanning diverse emerging and traditional IT infrastructures including cloud, virtualization, network, s ...
(DMTF).
WMI allows
scripting language
In computing, a script is a relatively short and simple set of instructions that typically automation, automate an otherwise manual process. The act of writing a script is called scripting. A scripting language or script language is a programming ...
s (such as
VBScript
VBScript (Microsoft Visual Basic Scripting Edition) is a deprecated programming language for scripting on Microsoft Windows using Component Object Model (COM), based on classic Visual Basic and Active Scripting. It was popular with system admi ...
or
PowerShell
PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a langu ...
) to manage
Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
personal computer
A personal computer, commonly referred to as PC or computer, is a computer designed for individual use. It is typically used for tasks such as Word processor, word processing, web browser, internet browsing, email, multimedia playback, and PC ...
s and
servers, both locally and remotely. WMI comes preinstalled in
Windows 2000
Windows 2000 is a major release of the Windows NT operating system developed by Microsoft, targeting the server and business markets. It is the direct successor to Windows NT 4.0, and was Software release life cycle#Release to manufacturing (RT ...
and later. It is available as a download for
Windows NT 4.0,
Windows 95
Windows 95 is a consumer-oriented operating system developed by Microsoft and the first of its Windows 9x family of operating systems, released to manufacturing on July 14, 1995, and generally to retail on August 24, 1995. Windows 95 merged ...
, and
Windows 98
Windows 98 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It was the second operating system in the 9x line, as the successor to Windows 95. It was Software ...
.
Also included with Windows was Windows Management Instrumentation Command-line (WMIC), a
CLI CLI may refer to:
Computing
* Call Level Interface, an SQL database management API
* Command-line interface, of a computer program
* Command-line interpreter or command language interpreter; see List of command-line interpreters
* CLI (x86 instruc ...
utility to interface with WMI. However, starting with
Windows 10, version 21H1 and
Windows Server 2022
Windows Server 2022 is the thirteenth major version of the Windows NT operating system produced by Microsoft to be released under the Windows Server brand name. It was announced at Microsoft's Ignite event from March 2–4, 2021. It was rele ...
, WMIC is deprecated in favor of
PowerShell
PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a langu ...
.
Purpose of WMI
The purpose of WMI is to define a proprietary set of environment-independent specifications that enable sharing management information between management apps. WMI prescribes
enterprise management standards and related technologies for Windows that work with existing management standards, such as
Desktop Management Interface (DMI) and
Simple Network Management Protocol
Simple Network Management Protocol (SNMP) is an Internet Standard protocol for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behavior. Devices that typically su ...
(SNMP). WMI complements these other standards by providing a uniform model for accessing management data from any source.
Development process
Because WMI abstracts the manageable entities with
Common Information Model (CIM) and a collection of providers, the development of a provider implies several steps. The major steps can be summarized as follows:
# Create the manageable entity model
## Define a model
## Implement the model
# Create the WMI provider
## Determine the provider type to implement
## Determine the hosting model of 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
# Test the provider
# Create consumer sample code.
Providers
Since the release of the first WMI implementation during the
Windows NT 4.0 SP4 era (as an out-of-band download),
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
has consistently added WMI providers to Windows:
* On
Windows NT 4.0, the WMI package shipped with 15 providers.
*
Windows 2000
Windows 2000 is a major release of the Windows NT operating system developed by Microsoft, targeting the server and business markets. It is the direct successor to Windows NT 4.0, and was Software release life cycle#Release to manufacturing (RT ...
shipped with 29 WMI providers.
*
Windows Server 2003
Windows Server 2003, codenamed "Whistler Server", is the sixth major version of the Windows NT operating system produced by Microsoft and the first server version to be released under the Windows Server brand name. It is part of the Windows NT ...
came with approximately 80 WMI providers.
*
Windows Vista
Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
includes 13 new WMI providers, hence ships with approximately 100 providers.
*
Windows Server 2008
Windows Server 2008, codenamed "Longhorn Server" (alternatives: "Windows Vista Server" or "Windows Server Vista"), is the seventh major version of the Windows NT operating system produced by Microsoft to be released under the Windows Server b ...
includes more providers for
IIS 7,
PowerShell
PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a langu ...
and
virtualization
In computing, virtualization (abbreviated v12n) is a series of technologies that allows dividing of physical computing resources into a series of virtual machines, operating systems, processes or containers.
Virtualization began in the 1960s wit ...
.
*
Windows 10
Windows 10 is a major release of Microsoft's Windows NT operating system. The successor to Windows 8.1, it was Software release cycle#Release to manufacturing (RTM), released to manufacturing on July 15, 2015, and later to retail on July 2 ...
adds 47 providers for the
Mobile Device Management
Mobile device management (MDM) is the administration of mobile devices, such as smartphones, tablet computers, and laptops. MDM is usually implemented with the use of a third-party product that has management features for particular vendors of ...
(MDM) service.
Many customers have interpreted the growth in numbers of providers as a sign that Microsoft envisions WMI as the ubiquitous management layer of Windows.
Beyond the scripting needs, most leading management solutions, such as
Microsoft Operations Mamager (MOM),
System Center Configuration Manager
Microsoft Configuration Manager (ConfigMgr) is a systems management software product developed by Microsoft for managing large groups of computers providing remote control, patch management, software distribution, operating system deployment, an ...
(SCCM),
Active Directory Services (ADS),
HP OpenView (HPOV), and the various offerings of
BMC Software and
CA, Inc. are WMI-enabled, i.e., capable of consuming and providing WMI information. This enables
administrators who lack WMI coding skills to benefit from WMI.
Features
WMI offers many features out of the box. Here are the most important advantages:
* Automation interfaces: WMI comes with a set of automation interfaces ready to use. Beyond the WMI class design and the provider development, the Microsoft development and test teams are not required to create, validate or test a scripting model as it is already available from WMI.
*
.NET
The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
management interfaces: The
System.Management
namespace makes WMI classes available to all .NET apps and scripts written in
C# or
PowerShell
PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a langu ...
. Beyond the WMI class design and the provider development, the Microsoft development and test teams are not required to create, validate and test new assemblies to support a new namespace in .NET as this support is already available from WMI.
* COM interfaces:
Unmanaged code in Microsoft Windows (e.g., apps written in
C or
C++ languages) can interact with the standard set of WMI interfaces for the
Component Object Model
Component Object Model (COM) is a binary-interface technology for software components from Microsoft that enables using objects in a language-neutral way between different programming languages, programming contexts, processes and machines ...
(COM) to access WMI providers and their supported WMI classes. Developers of WMI providers can leverage the same COM interfaces in their projects to furnish said classes.
* Remoting capabilities over DCOM and SOAP: In addition to local management via COM, WMI supports
remoting via
Distributed COM (DCOM) and
SOAP
Soap is a salt (chemistry), salt of a fatty acid (sometimes other carboxylic acids) used for cleaning and lubricating products as well as other applications. In a domestic setting, soaps, specifically "toilet soaps", are surfactants usually u ...
. The latter is available in
Windows Server 2003 R2 and later, through the
WS-Management initiative led by
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
,
Intel
Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
,
Sun Microsystems
Sun Microsystems, Inc., often known as Sun for short, was an American technology company that existed from 1982 to 2010 which developed and sold computers, computer components, software, and information technology services. Sun contributed sig ...
, and
Dell
Dell Inc. is an American technology company that develops, sells, repairs, and supports personal computers (PCs), Server (computing), servers, data storage devices, network switches, software, computer peripherals including printers and webcam ...
. This initiative allows running any scripts remotely or to consume WMI data through interfaces that handle SOAP requests and responses. WS-Management can consume everything that a WMI provider generates, although embedded objects in WMI instances were not supported until
Windows Vista
Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
. WS-Management later became an integral part of PowerShell. Unlike SOAP-based remoting, DCOM-based remoting requires a proxy
DLL deployed on each client machine.
* Support for queries: WMI offers support for
WQL queries.
This means WMI can still filter the results of a provider that doesn't implement filtering or queries.
* Event-handling capabilities: WMI can notify a subscriber of events of interest. WMI uses the
WQL to submit event queries and define the type of events to be returned. Anyone writing a WMI provider can have the benefit of this functionality at no cost for their customers. It will be up to consumers to decide how they desire to consume the management information exposed by the WMI provider.
To speed up the process of writing a WMI provider, the WMI team developed the ''WMI ATL Wizard'' to generate the code template implementing a provider. The code generated is based on the WMI class model initially designed by the developer. The WMI provider developer will be able to interface the pre-defined COM or DCOM interfaces for the WMI provider with its set of native APIs retrieving the management information to expose.
WMI is based on an industry standard called
Common Information Model (CIM) defined by the
Distributed Management Task Force
Distributed Management Task Force (DMTF) is a 501(c)(6) nonprofit industry standards organization that creates open manageability standards spanning diverse emerging and traditional IT infrastructures including cloud, virtualization, network, s ...
(DMTF). The
CIM class-based schema is defined by a consortium of manufacturers and software developers for the requirements of the industry. Any developer can write code that fits into this model. For instance,
Intel
Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
develops WMI providers for its
network adapters.
HP leveraged existing WMI providers and developed custom WMI providers for its
OpenView enterprise management solutions. IBM's
Tivoli management suite consumes WMI. Starting with
Windows XP SP2, Microsoft leverages WMI to get status information from
antivirus software
Antivirus software (abbreviated to AV software), also known as anti-malware, is a computer program used to prevent, detect, and remove malware.
Antivirus software was originally developed to detect and remove computer viruses, hence the name ...
and
firewalls.
Service
On the
Windows NT family
Windows NT is a proprietary graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Originally made for the workstation, office, and ser ...
of operating systems, WMI runs as a
Windows service
In Windows NT operating systems, a Windows service is a computer program that operates in the background. It is similar in concept to a Unix daemon. A Windows service must conform to the interface rules and protocols of the Service Control Manag ...
called
WinMgmt
. On the
Windows 9x
Windows 9x is a generic term referring to a line of discontinued Microsoft Windows operating systems released from 1995 to 2000 and supported until 2006, which were based on the kernel introduced in Windows 95 and modified in succeeding version ...
family, WMI runs in the context of the
WinMgmt.exe
executable file. On both Windows 9x and Windows NT families,
WinMgmt.exe
is available as a command-line utility for servicing the WMI repository.
WMI tools
Microsoft provides the following WMI tools for developers and IT pros:
* MOF compiler (
MOFComp.exe
): The Managed Object Format (MOF) compiler parses a file containing MOF statements and adds the classes and objects defined in the file to the CIM repository. The MOF format is a specific syntax to define CIM class representation in an
ASCII
ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
file. MOF's role for CIM is comparable to
MIB's role for
SNMP
Simple Network Management Protocol (SNMP) is an Internet Standard protocol for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behavior. Devices that typically su ...
.
MOFComp.exe
is included in every WMI installation. Every definition existing in the CIM repository is initially defined in an MOF file. MOF files are located in
%SystemRoot%\System32\WBEM
. During the WMI setup, they are loaded in the CIM repository.
* WMI Administrative Tools: This suite of tool consists of WMI CIM Studio, WMI Object Browser, WMI Event Registration, and WMI Event Viewer. The most important tool for a WMI provider developer is WMI CIM Studio as it helps in the initial WMI class creation in the CIM repository. It uses a web interface to display information and relies on a collection of
ActiveX
ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide W ...
components installed on the system when it runs for the first time. WMI CIM Studio can:
** Connect to a chosen system and browse the CIM repository in any namespace available.
** Search for classes by their name, by their descriptions or by property names.
** Review the properties, methods, and associations related to a given class.
** See the instances available for a given class of the examined system.
** Perform Queries in the WQL language.
** Generate an MOF file based on selected classes.
** Compile an MOF file to load it in the CIM repository.
*
WBEMTest.exe
is a WMI tester tool delivered with WMI. This tool allows an administrator or a developer to perform most of the tasks from a graphical interface that WMI provides at the
API
An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
level. Although available under all Windows NT-based operating systems, this tool is not officially supported by Microsoft. WBEMTest provides the ability to:
** Enumerate, open, create, and delete classes.
** Enumerate, open, create, and delete instances of classes.
** Select a
namespace
In computing, a namespace is a set of signs (''names'') that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified.
Namespaces ...
.
** Perform data and event queries.
** Execute methods associated to classes or instances.
** Execute every WMI operation asynchronously, synchronously or semi-asynchronously.
* WMI command line tool (WMIC) is a scripting and automation utility that allows information retrivial and system administration via WMI, using some simple keywords (aliases). WMIC.exe is available on all Windows versions since
Windows XP
Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
. Starting with
Windows 10, version 21H1 and
Windows Server 2022
Windows Server 2022 is the thirteenth major version of the Windows NT operating system produced by Microsoft to be released under the Windows Server brand name. It was announced at Microsoft's Ignite event from March 2–4, 2021. It was rele ...
, WMIC is deprecated in favor of
PowerShell
PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a langu ...
.
In
Windows 11, version 24H2, WMIC is not installed by default. A Linux port of WMIC,
wmi-client
, is written in
Python and is based on
Samba4.
* WBEMDump.exe: This command-line tool is a component of the
Platform SDK and comes a corresponding
Visual C++
Microsoft Visual C++ (MSVC) is a compiler for the C, C++, C++/CLI and C++/CX programming languages by Microsoft. MSVC is proprietary software; it was originally a standalone product but later became a part of Visual Studio and made available ...
project. The tool can show the CIM repository classes, instances, or both. It is possible to retrieve the same information WMIC retrieves.
WBEMDump.exe
requires more specific knowledge about WMI, as it doesn't abstract WMI as WMIC. It is also possible to execute methods exposed by classes or instances. Even if it is not a standard WMI tool delivered with the system installation, this tool can be quite useful for exploring the CIM repository and WMI features.
* WMIDiag.vbs (discontinued): The WMI Diagnosis Tool is a
VBScript
VBScript (Microsoft Visual Basic Scripting Edition) is a deprecated programming language for scripting on Microsoft Windows using Component Object Model (COM), based on classic Visual Basic and Active Scripting. It was popular with system admi ...
for testing and validating WMI on Windows 2000 and later. This script was downloadable from Microsoft until August 2020. The download includes pretty thorough documentation and the tool supports numerous switches. When run, it will generate up to four text files which: list the steps taken (the LOG file), an overview of the results (REPORT file), a statistics file (in comma separated values format), and optionally a file listing of the providers registered on the machine (PROVIDERS, also in comma separated values format). The report file that is generated includes a list of the issues identified and potential ways to fix them.
Wireless networking example
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
Wi-Fi () is a family of wireless network protocols based on the IEEE 802.11 family of standards, which are commonly used for Wireless LAN, local area networking of devices and Internet access, allowing nearby digital devices to exchange data by ...
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)
The
MSNdis_80211_ServiceSetIdentifier
WMI class is only supported on Windows XP and Windows Server 2003.
WMI driver extensions
The WMI extensions to
WDM provide kernel-level
instrumentation
Instrumentation is a collective term for measuring instruments, used for indicating, measuring, and recording physical quantities. It is also a field of study about the art and science about making measurement instruments, involving the related ...
such as publishing information, configuring device settings, supplying event notification from
device driver
In the context of an operating system, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabli ...
s, 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
Small Computer System Interface (SCSI, ) is a set of standards for physically connecting and transferring data between computers and peripheral devices, best known for its use with storage devices such as hard disk drives. SCSI was introduced ...
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 offer 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
Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
and later operating systems.
See also
*
Open Management Infrastructure
*
References
Further reading
*
External links
*
WMI Code Creator
{{DMTF standards
Management systems
Microsoft application programming interfaces
Network management
System administration
Windows communication and services
Windows components
Device drivers