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的)。web
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)。编程
WMI can be used in all Windows-based applications, and is most useful in enterprise applications and administrative scripts.windows
System administrators can find information about using WMI at the TechNet ScriptCenter, and in various books about WMI. For more information, see Further Information.api
译:WMI可用于全部基于Windows的应用程序,在企业应用程序和管理脚本中最有用。安全
系统管理员能够在TechNet ScriptCenter中找到有关使用WMI的信息,以及有关WMI的各类书籍。 有关更多信息,请参阅更多信息。服务器
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编写脚本。
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.
译:有关使用特定API元素或WMI类所需的操做系统的详细信息,请参阅WMI文档中每一个主题的“要求”部分。
若是缺乏预期的组件,请参阅WMI组件的操做系统可用性
您无需下载或安装特定的软件开发(SDK)便可为WMI建立脚本或应用程序。 可是,有一些WMI管理工具对开发者来讲颇有用。 有关更多信息,请参阅更多信息中的下载部分。
General information about WMI.
Information about how to develop applications to use WMI, which includes information about tools.
Documentation about the WMI classes, WMI C++ classes, WMI COM API, Scripting API, and other WMI reference material.
译:
关于WMI
有关WMI的通常信息。
使用WMI
有关如何开发应用程序以使用WMI的信息,其中包括有关工具的信息。
WMI参考
有关WMI类,WMI C ++类,WMI COM API,Scripting API和其余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
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管理数据。
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.
译:管理应用程序或脚本能够经过WMI以多种语言获取数据或执行操做。有关更多信息,请参见窗口管理规范中的“开发人员受众”部分
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.
译:许多Windows特性都有相关的WMI提供程序,好比引导配置数据(BCD)提供程序或存储卷提供程序。WMI提供者经过WMI类、方法和属性的描述来实现功能,从而管理相关的Windows特性。有关更多信息,请参见WMI提供程序和WMI类。
For more information about how to write a provider to supply data from new hardware or applications, see Providing Data to WMI.
译:有关如何编写提供程序来重新硬件或应用程序提供数据的更多信息,请参见向WMI提供数据。
For more information about how to implement this technology, see Using WMI.
译:有关如何实现此技术的更多信息,请参见使用WMI。
The following table lists topics included in this section.
Section | Description |
---|---|
What's New in WMI | New features in WMI. |
Operating System Availability of WMI Components | Some components are no longer available or are available as an optional installation. |
WMI Architecture | A 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 Model | A language independent programming model that uses object oriented techniques to describe an enterprise. |
Managed Object Format | A 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 WMI | User 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 Objects | WMI 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 WMI | Data from the system performance counters is available in WMI classes. |
IPv6 and IPv4 Support in WMI | WMI 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 Format | WMI uses the date and time formats defined by the Distributed Management Task Force CIM specification. For more information, see DMTF. |
Scripting Access to WMI | Write WMI scripts to perform management tasks. |
WMI Troubleshooting | When 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 Information | Websites, books, and articles about WMI. |
译:下表列出了本节中包含的主题
节 | 描述 |
---|---|
WMI中的新增功能 | WMI中的新增功能 |
WMI组件的操做系统可用性 | 某些组件再也不可用或做为可选安装提供。 |
WMI架构 | 管理应用程序经过使用各类接口与WMI进行通讯,例如Visual Basic,C ++,ODBC和ActiveX。 全部WMI接口都基于组件对象模型(COM)。 |
通用信息模型 | 一种语言无关的编程模型,它使用面向对象(oriented:面向 以什么为方向)的技术来描述企业。 |
管理对象格式 | 一种容许您建立人类可读代码的格式,操做系统能够将其转换为一组CIM类。您可使用新类为企业建模和控制新技术 |
用户账户控制和WMI | 用户账户控制(UAC)影响返回什么WMI数据、远程访问以及必须如何运行脚本。有关更多信息,请参见在Windows Vista上启动用户账户控制。 |
WMI安全对象的访问 | WMI使用标准的Windows安全对象和过程来控制和保护对WMI名称空间、打印机、服务和DCOM应用程序等安全对象的访问 |
性能库和WMI | 来自系统性能计数器的数据在WMI类中可用。 |
WMI中的IPv6和IPv4支持 | WMI IP路由提供程序和网络类为IPv4地址提供数据。从Windows Vista开始,WMI还提供了对IPv6网络功能(capability:功能 性能)的有限支持。 |
日期和时间格式 | WMI使用由分布式管理任务组CIM规范定义的日期和时间格式。有关更多信息,请参见DMTF。 |
对WMI的脚本访问 | 编写WMI脚原本执行管理任务。 |
WMI故障排除 | 在应用程序或脚本中访问WMI本地或远程数据时,可能会收到从丢失类到拒绝访问等错误。提供程序还提供调试选项和故障排除类。 |
更多信息 | 关于WMI的网站、书籍和文章。 |
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)安全特性
控制提供者安全性更改:
更改以加强WMI共享提供者主机进程(wmiprvse.exe)的安全性。这些变化为WMI共享主机引入了三种新的组策略和两种运行模式,称为安全兼容模式。有关更多信息,请参见注册表项以控制提供程序安全性。
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?
译:Windows管理工具的主要更新是下一代WMI的完整版本,即Windows管理基础设施(MI)。MI与之前的WMI版本彻底兼容,并提供了许多特性和好处,使设计和开发提供者和客户端比以往任什么时候候都更容易。有关MI的更多信息,请参见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中的新功能。
......
......
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 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.
译:要从WMI获取数据,能够编写访问WMI类的客户机脚本或应用程序,或者经过编写WMI提供程序向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基础设施与WMI提供者和托管对象之间的关系,还显示了WMI基础设施与WMI使用者之间的关系。
The following list describes the key WMI components:
译:下面的列表描述了关键的WMI组件
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存储库中。
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存储库由WMI名称空间组织。WMI服务在系统启动时建立一些名称空间,如root\default、root\cimv2和root\subscription,并预先安装一组默认的类定义,包括Win32类、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提供的。
Creating a WMI Application or Script
WMI Tasks for Scripts and Applications
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.
译:在WMI基础设施中,WMI服务(Winmgmt)是操做系统组件,充当管理应用程序和WMI数据提供者之间的中介(mediator:中介者)。WMI存储库是用于存储与WMI相关的静态数据的区域。
The WMI service is implemented as a service process within a shared service host process (SVCHOST). For more information, see Provider Hosting and Security.
译:WMI服务被实现为共享服务主机进程(SVCHOST)中的一个服务进程。有关更多信息,请参见提供程序托管和安全性。
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.
译:Providers向WMI服务注册他们的位置,这容许WMI路由数据请求。Providers还注册了对特定操做的支持,例如数据检索、修改、删除、枚举或查询处理。WMI服务使用Providers注册信息将应用程序请求与适当的Providers匹配。WMI还根据须要使用注册信息加载和卸载Providers。当Providers完成处理请求时,Providers将结果返回给WMI服务。而后WMI将结果转发给应用程序
WMI uses Event Tracing (ETW) to record WMI service activity.
译:WMI使用事件跟踪(ETW)来记录WMI服务活动。
Because the infrastructure handles all traffic between the providers and the management applications, the infrastructure provides the following features:
译:由于基础设施处理Providers和管理应用程序之间的全部通讯,因此基础设施提供了如下特性
Event Notification Support(事件通知支持)
For more information, see Monitoring Events.
Query Language Support(查询语言支持)
For more information, see Querying with WQL.
Security Support(安全支持)
For more information, see Maintaining WMI Security.
Scripting Access to Performance Counter Data(对性能计数器数据的脚本访问)
For more information, see Monitoring Performance Data.
......
......
......
......
......
......
......
......
......
......
......
......