Windows Management Instrumentation


Windows Management Instrumentation (WMI) is the infrastructure for management data and operations on Windows-based operating systems. You can write WMI scripts or applications to automate administrative tasks on remote computers but WMI also supplies management data to other parts of the operating system and products, for example System Center Operations Manager, formerly Microsoft Operations Manager (MOM), or Windows Remote Management (WinRM).

译:Windows Management Instrumentation(WMI)是基于Windows的操作系统管理数据和操作的基础结构(infrastructure:基础结构)。 您可以编写WMI脚本或应用程序以自动执行(automate: 自动操作 自动处理)远程计算机上的管理(administrative:行政的 管理类)任务,但WMI还将管理数据提供给操作系统和产品的其他部分,例如System Center Operations Manager,以前的Microsoft Operations Manager(MOM)或Windows远程管理( WinRM的)。

WMI is fully supported by Microsoft; however, the latest version of administrative scripting and control is available through the Windows Management Infrastructure (MI). MI is fully compatible with previous versions of WMI, and provides a host of features and benefits that make designing and developing providers and clients easier than ever. For more information, see Windows Management Infrastructure (MI).

译:WMI得到了微软的全力支持; 但是,可以通过Windows Management Infrastructure(MI)获得(avaiable:可获得的 可用的)最新版本的管理脚本和控制。 MI与以前版本的WMI完全兼容,并提供了许多(a host of:许多)功能(features)和优势(benefits),使设计和开发提供商和客户比以往更容易。 有关更多信息,请参阅Windows Management Infrastructure(MI)。

Where applicable(适用情况)

WMI can be used in all Windows-based applications, and is most useful in enterprise applications and administrative scripts.

System administrators can find information about using WMI at the TechNet ScriptCenter, and in various books about WMI. For more information, see Further Information.


系统管理员可以在TechNet ScriptCenter中找到有关使用WMI的信息,以及有关WMI的各种书籍。 有关更多信息,请参阅更多信息。

Developer audience(开发人员)

WMI is designed for programmers who use C/C++, the Microsoft Visual Basic application, or a scripting language that has an engine on Windows and handles Microsoft ActiveX objects. While some familiarity with COM programming is helpful, C++ developers who are writing applications can find good examples for getting started at Creating a WMI Application Using C++.

To develop managed code providers or applications in C# or Visual Basic .NET using the .NET Framework, see WMI in .NET Framework.

Many administrators and IT professionals access WMI through PowerShell. The Get-WMI cmdlet for PowerShell enables you to retrieve information for a local or remote WMI repository. As such, a number of topics and classes, especially in the Creating WMI Clients section, contain PowerShell examples. For additional information on using PowerShell, see Windows PowerShell and Scripting with Windows PowerShell.

译:WMI专为使用C / C ++,Microsoft Visual Basic应用程序或在Windows上具有引擎并处理Microsoft ActiveX对象的脚本语言的程序员而设计。 虽然熟悉COM编程很有帮助,但用C++编写应用程序的开发人员可以找到很好的例子来开始使用C ++创建WMI应用程序。

要使用.NET Framework在C#或Visual Basic .NET中开发托管代码提供程序或应用程序,请参阅.NET Framework中的WMI。

许多管理员和IT专业人员通过PowerShell访问(access:访问 进入)WMI。PowerShell的Get-WMI cmdlet使您能够检索(retrieve:检索 取回)本地或远程WMI存储库(repository:仓库 资源库 存储库)的信息。因此,许多主题和类,特别是在创建WMI客户机部分中,都包含PowerShell示例。有关使用PowerShell的更多信息,请参见Windows PowerShell和使用Windows PowerShell编写脚本。

Run-time requirements(运行时的要求)

For more information about which operating system is required to use a specific API element or WMI class, see the Requirements section of each topic in the WMI documentation.

If an expected component appears to be missing, see Operating System Availability of WMI Components.

You do not need to download or install a specific software development (SDK) in order to create scripts or applications for WMI. However, there are some WMI administrative tools that developers find useful. For more information, see the Downloads section in Further Information.



您无需下载或安装特定的软件开发(SDK)即可为WMI创建脚本或应用程序。 但是,有一些WMI管理工具对开发者来说很有用。 有关更多信息,请参阅更多信息中的下载部分。

In this section(本节内容)

About WMI

General information about WMI.

Using WMI

Information about how to develop applications to use WMI, which includes information about tools.

WMI Reference

Documentation about the WMI classes, WMI C++ classes, WMI COM API, Scripting API, and other WMI reference material.

有关WMI类,WMI C ++类,WMI COM API,Scripting API和其他WMI参考资料的文档。

About WMI

About WMI

Windows Management Instrumentation (WMI) is the Microsoft implementation of Web-Based Enterprise Management (WBEM), which is an industry initiative to develop a standard technology for accessing management information in an enterprise environment. WMI uses the Common Information Model (CIM) industry standard to represent systems, applications, networks, devices, and other managed components. CIM is developed and maintained by the Distributed Management Task Force (DMTF).

The next-generation of WMI, known as the Windows Management Infrastructure (MI), is currently available. MI is fully compatible with previous versions of WMI, and provides a host of features and benefits that make designing and developing providers and clients easier than ever. For example, many newer providers are written using the MI framework, but can be accessed using WMI scripts and applications. For more information about the differences between the two technologies, see Why Use MI?

译:Windows管理工具(instrumentation:工具 仪表)(WMI)是微软基于web的企业管理(WBEM)的实现,这是一个行业倡议(initiative:倡议 主动性),旨在开发一种在企业环境中访问管理信息的标准技术。WMI使用公共信息模型(CIM)行业(industry:工业 行业)标准表示系统、应用程序、网络、设备和其他托管组件。CIM由分布式管理任务组(DMTF)开发和维护。

下一代WMI,即Windows管理基础设施(infrastructure:基础设施 基础架构)(MI),目前是可用的。MI与以前的WMI版本完全兼容,并提供了许多特性和好处,使设计和开发提供者和客户端比以往任何时候都更容易。例如,许多较新的提供程序是使用MI框架编写的,但是可以使用WMI脚本和应用程序访问它们。有关这两种技术之间的差异的更多信息,请参见为什么使用MI

Managing Remote Computer Systems with WMI(使用WMI管理远程计算机系统)

The ability to obtain management data from remote computers is what makes WMI useful. Remote WMI connections are made through DCOM. An alternative is to use Windows Remote Management (WinRM), which obtains remote WMI management data using the WS-Management SOAP-based protocol.

译:从远程计算机获取管理数据的能力使WMI非常有用。远程WMI连接是通过DCOM进行的。另一种方法是使用Windows Remote Management (WinRM),它使用WS-Management soap-based的协议获取远程WMI管理数据。

Programming with WMI(WMI编程)

Management applications or scripts can get data or perform operations through WMI in a variety of languages. For more information, see the Developer Audience section at Windows Management Instrumentation.


Many Windows features have associated WMI providers, like the Boot Configuration Data (BCD) Provider or the Storage Volume Provider. WMI Providers implement the functionality described by WMI classes methods and properties to manage associated Windows features. For more information, see WMI Providers and WMI Classes.


For more information about how to write a provider to supply data from new hardware or applications, see Providing Data to WMI.


For more information about how to implement this technology, see Using WMI.


The following table lists topics included in this section.

What's New in WMINew features in WMI.
Operating System Availability of WMI ComponentsSome components are no longer available or are available as an optional installation.
WMI ArchitectureA management application communicates with WMI by using a variety of interfaces, such as Visual Basic, C++, ODBC, and ActiveX. All the WMI interfaces are based on the Component Object Model (COM).
Common Information ModelA language independent programming model that uses object oriented techniques to describe an enterprise.
Managed Object FormatA format that enables you to create human-readable code, which the operating system can translate into a set of CIM classes. You can use the new classes to model and control new technologies for an enterprise.
User Account Control and WMIUser Account Control (UAC) affects what WMI data is returned, remote access, and how scripts must be run. For more information, see Getting Started with User Account Control on Windows Vista.
Access to WMI Securable ObjectsWMI uses standard Windows security objects and procedures to control and protect access to securable objects like WMI namespaces, printers, services, and DCOM applications.
Performance Libraries and WMIData from the system performance counters is available in WMI classes.
IPv6 and IPv4 Support in WMIWMI IP Route Provider and network classes supply data for IPv4 addresses. Starting with Windows Vista, WMI also provides limited support for IPv6 network capabilities.
Date and Time FormatWMI uses the date and time formats defined by the Distributed Management Task Force CIM specification. For more information, see DMTF.
Scripting Access to WMIWrite WMI scripts to perform management tasks.
WMI TroubleshootingWhen accessing WMI local or remote data in an application or script, you may receive errors ranging from missing classes to access denied. Providers also have debugging options and troubleshooting classes available.
Further InformationWebsites, books, and articles about WMI.


WMI架构管理应用程序通过使用各种接口与WMI进行通信,例如Visual Basic,C ++,ODBC和ActiveX。 所有WMI接口都基于组件对象模型(COM)。
通用信息模型一种语言无关的编程模型,它使用面向对象(oriented:面向 以什么为方向)的技术来描述企业。
用户帐户控制和WMI用户帐户控制(UAC)影响返回什么WMI数据、远程访问以及必须如何运行脚本。有关更多信息,请参见在Windows Vista上启动用户帐户控制。
WMI中的IPv6和IPv4支持WMI IP路由提供程序和网络类为IPv4地址提供数据。从Windows Vista开始,WMI还提供了对IPv6网络功能(capability:功能 性能)的有限支持。

Using WMI

WMI Reference

What's New in WMI

What's New in WMI

New Security Feature in Windows 7(Windows 7的新安全特性)

The following lists the new Windows Management Instrumentation (WMI) security feature that is available in Windows 7.

Controlling provider security

Changes to enhance the security of the WMI shared provider host process (wmiprvse.exe). These changes introduce three new group policies and two running modes for the WMI shared host, which are called secure and compatible modes. For more information, see Registry Keys for Controlling Provider Security.

译:下面列出了Windows 7中新的Windows管理工具(WMI)安全特性


New or Updated Features in Windows 8

The main update to Windows Management Instrumentation was the full release of the next-generation version of WMI, known as Windows Management Infrastructure (MI). MI is fully compatible with previous versions of WMI, and provides a host of features and benefits that make designing and developing providers and clients easier than ever. For more information on MI, see What's New in MI?


For more information about new features for WMI in previous operating system versions, see What's New in Windows 7, and What's New in Windows Vista.

译:有关WMI在以前的操作系统版本中的新功能的更多信息,请参见Windows 7和Windows Vista中的新功能。

About WMI

What's New in Windows 7


What's New in Windows Vista


Operating System Availability of WMI Components

WMI is installed by default on all Windows desktop and server platforms. However, certain WMI providers may or may not be installed, depending on the OS release and configuration. For example, the SNMP provider is not enabled by default, and the Windows Installer provider (MSI provider) is not installed by default on 64-bit operating systems. For more information about the availability of a specific provider, see WMI Providers.

译:默认情况下,WMI安装在所有Windows桌面和服务器平台上。 但是,某些WMI提供程序可能已安装,也可能未安装,具体取决于操作系统版本和配置。 例如,默认情况下不启用SNMP提供程序,默认情况下,64位操作系统上未安装Windows Installer提供程序(MSI提供程序)。 有关特定提供程序的可用性的详细信息,请参阅WMI提供程序。

WMI Architecture

WMI Architecture(WMI架构)

WMI provides a uniform interface for any local or remote applications or scripts that obtain management data from a computer system, a network, or an enterprise. The uniform interface is designed such that WMI client applications and scripts do not have to call a wide variety of operating system application programming interfaces (APIs). Many APIs cannot be called by automation clients like scripts or Visual Basic applications. Other APIs do not make calls to remote computers.

译:WMI为从计算机系统、网络或企业获取管理数据的任何本地或远程应用程序或脚本提供了统一的接口。统一接口的设计使得WMI客户机应用程序和脚本不必调用各种操作系统应用程序编程接口(api)。许多api不能被自动化客户机(如脚本或Visual Basic应用程序)调用。其他api不调用远程计算机。

To obtain data from WMI, write a client script or application that accesses WMI Classes or provide data to WMI by writing a WMI provider. For more information, see Using WMI.


Objects, Consumers, and Infrastructure of WMI(WMI的对象、使用者和基础设施)

The following diagram shows the relationship between the WMI infrastructure and the WMI providers and managed objects, and it also shows the relationship between the WMI infrastructure and the WMI consumers.



WMI Components(WMI组件)

The following list describes the key WMI components:


  • Managed objects and WMI providers
    A WMI provider is a COM object that monitors one or more managed objects for WMI. A managed object is a logical or physical enterprise component, such as a hard disk drive, network adapter, database system, operating system, process, or service.

    Similar to a driver, a provider supplies WMI with data from a managed object and handles messages from WMI to the managed object. WMI providers consist of a DLL file and a Managed Object Format (MOF) file that defines the classes for which the provider returns data and performs operations. Providers, like WMI C++ applications, use the COM API for WMI. For more information, see Providing Data to WMI.

    An example of a provider is the preinstalled Registry provider, which accesses data in the system registry. The Registry provider has one WMI class, StdRegProv, with many methods but no properties. Other preinstalled providers, such as the Win32 provider, usually have classes with many properties but few methods, such as Win32_Process or Win32_LogicalDisk. The Registry provider DLL file, Stdprov.dll, contains the code that dynamically returns data when requested by client scripts or applications.

    WMI MOF and DLL files are located in %WINDIR%\System32\Wbem, along with the WMI Command-Line Tools, such as Winmgmt.exe and Mofcomp.exe. Provider classes, such as Win32_LogicalDisk, are defined in MOF files, and then compiled into the WMI repository at system startup.


  • 托管对象和WMI提供程序
    WMI提供程序是一个COM对象,它监视WMI的一个或多个托管对象。 托管对象是逻辑或物理企业组件,例如硬盘驱动器,网络适配器,数据库系统,操作系统,进程或服务。

    与驱动程序类似,提供程序为WMI提供来自托管对象的数据,并处理从WMI到托管对象的消息。 WMI提供程序由DLL文件和托管对象格式(MOF)文件组成,该文件定义提供程序返回数据并执行操作的类。 像WMI C ++应用程序一样,提供程序使用WMI的COM API。 有关更多信息,请参阅向WMI提供数据。

    提供程序的一个示例是预安装的注册表提供程序,它访问系统注册表中的数据。注册表提供程序只有一个WMI类StdRegProv,有很多方法,但是没有属性。其他预安装的提供程序,如Win32提供程序,通常具有具有许多属性但方法很少的类,如Win32 Process或Win32 LogicalDisk。注册表提供程序DLL文件,Stdprov.dll,包含客户端脚本或应用程序请求时动态返回数据的代码。

    WMI MOF和DLL文件位于%WINDIR%\System32\Wbem中,以及WMI命令行工具,如winmgm .exe和mofcom .exe。提供程序类(如Win32 LogicalDisk)在MOF文件中定义,然后在系统启动时编译到WMI存储库中。

  • WMI infrastructure

    The WMI infrastructure is a Microsoft Windows operating system component know as the WMI service(winmgmt). The WMI infrastructure has two components: the WMI Core, and the WMI repository.

    The WMI repository is organized by WMI namespaces. The WMI service creates some namespaces such as root\default, root\cimv2, and root\subscription at system startup and preinstalls a default set of class definitions, including the Win32 Classes, the WMI System Classes, and others. The remaining namespaces found on your system are created by providers for other parts of the operating system or products. For more information and a list of WMI providers found in most operating system versions, see WMI Providers.

    The WMI service acts as an intermediary between the providers, management applications, and the WMI repository. Only static data about objects is stored in the repository, such as the classes defined by providers. WMI obtains most data dynamically from the provider when a client requests it. You also can set up subscriptions to receive event notifications from a provider. For more information, see Monitoring Events.


  • WMI基础设施

    WMI基础设施是一个Microsoft Windows操作系统组件,称为WMI服务(winmgmt)。WMI基础设施有两个组件:WMI核心和WMI存储库。


    WMI服务充当providers、管理应用程序和WMI存储库之间的中介。只有关于对象的静态数据存储在存储库中,例如providers定义的类。当客户机请求提供程序时,WMI动态地从提供程序获取大部分数据。您还可以设置订阅(subscription:订阅 订阅者)以接收来自providers的事件通知(notification:通知 通知单)。有关更多信息,请参见监视(monitor:监控 监视)事件

  • WMI consumers(WMI使用者)

    A WMI consumer is a management application or script that interacts with the WMI infrastructure. A management application can query, enumerate data, run provider methods, or subscribe to events by calling either the COM API for WMI or the Scripting API for WMI. The only data or actions available for a managed object, such as a disk drive or a service, are those that a provider supplies.


  • WMI使用者

    WMI使用者是与WMI基础结构交互的管理应用程序或脚本。 管理应用程序可以通过调用WMI的COM API或WMI的Scripting API来查询,枚举数据,运行提供程序方法或订阅事件。 托管对象(如磁盘驱动器或服务)惟一可用的数据或操作是providers提供的。

Using WMI

WMI Providers

Creating a WMI Application or Script

WMI Tasks for Scripts and Applications

Providing Data to WMI

WMI Classes

Monitoring Events

Calling a Method

WMI Infrastructure(WMI基础设施)

In the WMI infrastructure, the WMI service (Winmgmt) is the operating system component that acts as the mediator between management applications and WMI data providers. The WMI repository is a storage area for WMI-related static data.


The WMI service is implemented as a service process within a shared service host process (SVCHOST). For more information, see Provider Hosting and Security.


The WMI service starts when the first management application or script makes a call to connect to a WMI namespace. Depending on the setup, the WMI service may shut down or go into a low memory profile when not being called by a management application.

译:当第一个管理应用程序或脚本调用连接到WMI名称空间时,WMI服务将启动。根据设置(setup)的不同,当管理应用程序不调用WMI服务时,它可能会关闭或进入低内存配置文件(profile:配置文件 简介)。

The WMI service interacts with management applications through the COM interface. When an application makes a request through the interface, WMI determines whether the request is for static or dynamic data. If the request involves static data, such as the name of a managed object, WMI retrieves the data from the repository. If the request involves dynamic data, such as the amount of memory a managed object is currently using, WMI passes the request on to a provider.

译:WMI服务通过COM接口与管理应用程序交互(interact:互动 互相影响)。 当应用程序通过接口发出请求时,WMI会确定请求是针对静态数据还是动态数据。 如果请求涉及静态数据(例如托管对象的名称),WMI将从存储库中检索数据。 如果请求涉及动态数据,例如托管对象当前使用的内存量,则WMI会将请求传递给providers。

Providers register their location with the WMI service, which allows WMI to route data requests. A provider also registers support for particular operations, such as data retrieval, modification, deletion, enumeration, or query processing. The WMI service uses the provider registration information to match application requests with the appropriate provider. WMI also uses the registration information to load and unload providers, as necessary. When a provider finishes processing a request, the provider returns the result back to the WMI service. WMI then forwards the result on to the application through the COM interface. For more information, see Providing Data to WMI.


WMI uses Event Tracing (ETW) to record WMI service activity.


Because the infrastructure handles all traffic between the providers and the management applications, the infrastructure provides the following features:


WMI Architecture

Common Information Model


Cross-Namespace Association Traversal


Managed Object Format(MOF)


User Account Control and WMI


Access to WMI Securable Objects


Performance Libraries and WMI


IPv6 and IPv4 Support in WMI


Date adn Time Format


Scripting Access to WMI


Further Information


Using WMI


WMI Reference


WMI Glossary


已标记关键词 清除标记
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页