Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Windows Management Instrumentation
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Windows interface for monitoring and notification}} {{Infobox software | name = Windows Management Instrumentation | developer = [[Microsoft]] | operating system = [[Microsoft Windows]] | platform = [[IA-32]], [[x86-64]], and [[ARM architecture|ARM]] (historically [[Itanium]], [[DEC Alpha]], [[MIPS architecture|MIPS]], and [[PowerPC]]) | genre = [[Systems management]] | license = Same as [[Microsoft Windows]] | website = {{URL|https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page}} }} '''Windows Management Instrumentation''' ('''WMI''') is a set of extensions to the [[Windows Driver Model]] that provides an [[operating system]] interface through which [[Instrumentation (computer programming)|instrumented]] components provide information and notification. WMI is [[Microsoft]]'s implementation of the [[Web-Based Enterprise Management]] (WBEM) and [[Common Information Model (computing)|Common Information Model]] (CIM) standards from the [[Distributed Management Task Force]] (DMTF). WMI allows [[scripting language]]s (such as [[VBScript]] or [[PowerShell]]) to manage [[Microsoft Windows]] [[personal computer]]s and [[Server (computing)|server]]s, both locally and remotely. WMI comes preinstalled in [[Windows 2000]] and later. It is available as a download for [[Windows NT 4.0]],<ref name=WMINTDownload>{{cite web |title=WMI Redistributable for Windows NT |website=microsoft.com |url=http://www.microsoft.com/downloads/details.aspx?familyid=C174CFB1-EF67-471D-9277-4C2B1014A31E&displaylang=en |access-date=4 May 2018 |url-status=dead |archive-url=https://web.archive.org/web/20100224082551/http://www.microsoft.com/downloads/details.aspx?FamilyID=c174cfb1-ef67-471d-9277-4c2b1014a31e&DisplayLang=en |archive-date=24 February 2010}}</ref> [[Windows 95]], and [[Windows 98]].<ref name=WMIDownload>{{cite web |title=WMI Redistributable for Windows 95 and Windows 98 |website=microsoft.com |url=http://www.microsoft.com/downloads/details.aspx?familyid=98a4c5ba-337b-4e92-8c18-a63847760ea5&displaylang=en |access-date=4 May 2018 |url-status=dead|archive-url=https://web.archive.org/web/20070423223349/http://www.microsoft.com/downloads/details.aspx?familyid=98a4c5ba-337b-4e92-8c18-a63847760ea5&displaylang=en |archive-date=23 April 2007}}</ref> Also included with Windows was '''Windows Management Instrumentation Command-line''' ('''WMIC'''), a [[Command-line interface|CLI]] utility to interface with WMI.<ref>{{cite web |title=A Description of the Windows Management Instrumentation (WMI) Command-Line Utility (Wmic.exe) |url=https://support.microsoft.com/en-us/topic/a-description-of-the-windows-management-instrumentation-wmi-command-line-utility-wmic-exe-f5c16751-3a83-49ee-030d-5092ce1a04bb |url-status=live |archive-url=https://web.archive.org/web/20070502013243/http://support.microsoft.com/kb/290216 |archive-date=2007-05-02}}</ref> However, starting with [[Windows 10, version 21H1]] and [[Windows Server 2022]], WMIC is deprecated in favor of [[PowerShell]].<ref name=":0">{{Cite web|title=WMIC: WMI command-line utility|publisher=Microsoft|date=8 March 2023|url=https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic|url-status=live|archive-url=https://web.archive.org/web/20231014121916/https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic|archive-date=14 October 2023}}</ref> ==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 [[systems management|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]] (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 (computing)|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 [[Active Template Library|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== {{Missing information|the nature of WMI providers|date=February 2025}} 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: * On [[Windows NT 4.0]], the WMI package shipped with 15 providers. * [[Windows 2000]] shipped with 29 WMI providers. * [[Windows Server 2003]] came with approximately 80 WMI providers. * [[Windows Vista]] includes 13 new WMI providers,<ref>{{cite web |title=Windows Vista Client Manageability |website=microsoft.com |url=http://download.microsoft.com/download/b/e/3/be37cbce-425e-45c2-a9f5-378026b5be81/04-d-WinMgmtTech-v03-TOURB-FINAL.ppt |access-date=4 May 2018 |url-status=live |archive-url=https://web.archive.org/web/20160303175059/http://download.microsoft.com/download/b/e/3/be37cbce-425e-45c2-a9f5-378026b5be81/04-d-WinMgmtTech-v03-TOURB-FINAL.ppt |archive-date=3 March 2016}}</ref> hence ships with approximately 100 providers. * [[Windows Server 2008]] includes more providers for [[Internet Information Services|IIS 7]], [[PowerShell]] and [[Virtualization Technology|virtualization]]. * [[Windows 10]] adds 47 providers for the [[Mobile Device Management]] (MDM) service.<ref>{{ cite web |title=WMI providers supported in Windows 10 |website=[[Microsoft]] |date=25 June 2017 |url=https://learn.microsoft.com/en-us/windows/client-management/wmi-providers-supported-in-windows#mdm-wmi-classes |access-date=30 September 2018 |url-status=live |archive-url=https://web.archive.org/web/20180930123815/https://docs.microsoft.com/en-us/windows/client-management/mdm/wmi-providers-supported-in-windows |archive-date=30 September 2018}}</ref> 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 Manager|Microsoft Operations Mamager]] (MOM), [[System Center Configuration Manager]] (SCCM), [[Active Directory Services]] (ADS), [[Hewlett-Packard|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 [[system administrator|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]] management interfaces:''' The <code>System.Management</code> namespace<ref>{{cite web |date=7 February 2025 |title=System.Management Namespace |url=https://learn.microsoft.com/en-us/dotnet/api/system.management |website=.NET Library |publisher=[[Microsoft]] |via=[[Microsoft Learn]]}}</ref> makes WMI classes available to all .NET apps and scripts written in [[C Sharp (programming language)|C#]] or [[PowerShell]]. 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 (programming language)|C]] or [[C++]] languages) can interact with the standard set of WMI interfaces for the [[Component Object Model]] (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 Component Object Model|Distributed COM]] (DCOM) and [[SOAP]]. The latter is available in [[Windows Server 2003 R2]] and later, through the [[WS-Management]] initiative led by [[Microsoft]], [[Intel]], [[Sun Microsystems]], and [[Dell]]. 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]]. WS-Management later became an integral part of PowerShell. Unlike SOAP-based remoting, DCOM-based remoting requires a proxy [[Dynamic-link library|DLL]] deployed on each client machine. * '''Support for queries:''' WMI offers support for [[WQL]] queries.<ref name="WQLviaPowerShell">{{cite web |title=WMI query language (WQL) via PowerShell |website=ravichaganti.com |date=1 May 2011 |url=http://ravichaganti.com/blog/publications/ebook-wmi-query-language-wql-via-powersahell/ |access-date=4 May 2018 |url-status=dead |archive-url=https://web.archive.org/web/20171012210736/http://www.ravichaganti.com/blog/publications/ebook-wmi-query-language-wql-via-powersahell/ |archive-date=12 October 2017}}</ref> 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 (computing)|Common Information Model]] (CIM) defined by the [[Distributed Management Task Force]] (DMTF). The [[CIM Schema|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]] develops WMI providers for its [[Network adapter|network adapters]]. [[HP Inc.|HP]] leveraged existing WMI providers and developed custom WMI providers for its [[HP OpenView|OpenView]] enterprise management solutions. IBM's [[Tivoli Software|Tivoli]] management suite consumes WMI. Starting with [[Windows XP SP2]], Microsoft leverages WMI to get status information from [[antivirus software]] and [[Firewall (computing)|firewalls]]. == Service == On the [[Windows NT family]] of operating systems, WMI runs as a [[Windows service]] called <code>WinMgmt</code>. On the [[Windows 9x]] family, WMI runs in the context of the <code>WinMgmt.exe</code> executable file. On both Windows 9x and Windows NT families, <code>WinMgmt.exe</code> is available as a command-line utility for servicing the WMI repository.<ref>{{Cite web |last=White |first=Steven |date=3 November 2023 |title=winmgmt |url=https://learn.microsoft.com/en-us/windows/win32/wmisdk/winmgmt |website=Windows App Development |publisher=[[Microsoft]] |via=[[Microsoft Learn]]}}</ref> ==WMI tools== Microsoft provides the following WMI tools for developers and IT pros: * '''MOF compiler (<code>MOFComp.exe</code>):''' 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]] file. MOF's role for CIM is comparable to [[Management information base|MIB]]'s role for [[Simple Network Management Protocol|SNMP]]. <code>MOFComp.exe</code> 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 <code>%SystemRoot%\System32\WBEM</code>. 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]] 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. * <code>'''WBEMTest.exe'''</code> 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]] 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]]. ** 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]]. Starting with [[Windows 10, version 21H1]] and [[Windows Server 2022]], WMIC is deprecated in favor of [[PowerShell]].<ref name=":0" /> In [[Windows 11, version 24H2]], WMIC is not installed by default. A Linux port of WMIC, <code>wmi-client</code>, is written in [[Python (programming language)|Python]] and is based on [[Samba4]].<ref>{{cite web |title=Ubuntu β Error |first=Rhonda |last=D'Vine |website=packages.ubuntu.com |url=http://packages.ubuntu.com/hardy/python/wmi-client |access-date=4 May 2018 |url-status=live |archive-url=https://web.archive.org/web/20170502194634/http://packages.ubuntu.com/hardy/python/wmi-client |archive-date=2 May 2017}}</ref> * '''WBEMDump.exe:''' This command-line tool is a component of the [[Microsoft Windows SDK|Platform SDK]] and comes a corresponding [[Microsoft Visual C++|Visual C++]] project. The tool can show the CIM repository classes, instances, or both. It is possible to retrieve the same information WMIC retrieves. <code>WBEMDump.exe</code> 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]] for testing and validating WMI on Windows 2000 and later. This script was downloadable from Microsoft until August 2020.<ref>{{Cite web |date=24 April 2015 |title=The WMI Diagnosis Utility -- Version 2.2 |url=https://www.microsoft.com/en-us/download/details.aspx?id=7684 |url-status=dead |archive-url=https://web.archive.org/web/20200806145556/https://www.microsoft.com/en-us/download/details.aspx?id=7684 |archive-date=6 August 2020 |website=Download Center |publisher=[[Microsoft]]}}</ref> 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 <code>Win32_LogicalDisk</code> in the case of a disk drive, or a <code>Win32_Process</code>, such as a running program like <code>Notepad.exe</code>. This example shows how <code>MSNdis_80211_ServiceSetIdentifier</code> WMI class is used to find the [[SSID]] of the [[Wi-Fi]] network that the system is currently connected to in the language C#: <syntaxhighlight lang="csharp"> 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"]; } </syntaxhighlight> The <code>MSNdis_80211_ServiceSetIdentifier</code> WMI class is only supported on Windows XP and Windows Server 2003. ==WMI driver extensions== The WMI extensions to [[Windows Driver Model|WDM]] provide kernel-level [[instrumentation (computer programming)|instrumentation]] such as publishing information, configuring device settings, supplying event notification from [[device driver]]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]] and [[Network Driver Interface Specification|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 [[original equipment manufacturer|OEM]]s and [[independent hardware vendor|IHV]]s 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.<ref>{{cite web |title=The Windows Vista and Windows "Longhorn" Server Developer Story: Application Compatibility Cookbook |website=msdn2.microsoft.com |url=http://msdn2.microsoft.com/en-us/library/aa480152.aspx#appcomp_topic16 |access-date=4 May 2018 |url-status=live |archive-url=https://web.archive.org/web/20080421122427/http://msdn2.microsoft.com/en-us/library/aa480152.aspx#appcomp_topic16 |archive-date=21 April 2008}}</ref> ==See also== * [[Open Management Infrastructure]] * {{Section link|ANT catalog|WISTFULTOLL}} ==References== {{Reflist}} ==Further reading== * {{Cite web |url=https://devblogs.microsoft.com/powershell/improved-support-for-wmi/ |first=Jeffrey |last=Snover |title=Improved Support for WMI |website=PowerShell Blog |via=Dev Blogs |publisher=[[Microsoft]] |date=26 June 2006}} ==External links== * {{Official website|https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page}} * [https://www.microsoft.com/en-us/download/details.aspx?id=8572 WMI Code Creator] {{Microsoft APIs}} {{Microsoft Windows components}} {{DMTF standards}} [[Category:Management systems]] [[Category:Microsoft application programming interfaces]] [[Category:Network management]] [[Category:System administration]] [[Category:Windows communication and services]] [[Category:Windows components]] [[Category:Device drivers]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite web
(
edit
)
Template:DMTF standards
(
edit
)
Template:Infobox software
(
edit
)
Template:Microsoft APIs
(
edit
)
Template:Microsoft Windows components
(
edit
)
Template:Missing information
(
edit
)
Template:Official website
(
edit
)
Template:Reflist
(
edit
)
Template:Section link
(
edit
)
Template:Short description
(
edit
)