wmi

Windows Management Instrumentation

Purpose(用途)

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)。編程

Where applicable(適用狀況)

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的各類書籍。 有關更多信息,請參閱更多信息。服務器

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.

譯:有關使用特定API元素或WMI類所需的操做系統的詳細信息,請參閱WMI文檔中每一個主題的「要求」部分。

若是缺乏預期的組件,請參閱WMI組件的操做系統可用性

您無需下載或安裝特定的軟件開發(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的通常信息。
使用WMI
有關如何開發應用程序以使用WMI的信息,其中包括有關工具的信息。
WMI參考
有關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.

譯:管理應用程序或腳本能夠經過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的網站、書籍和文章。

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)安全特性
控制提供者安全性更改:

更改以加強WMI共享提供者主機進程(wmiprvse.exe)的安全性。這些變化爲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?

譯: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中的新功能。

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.

譯:要從WMI獲取數據,能夠編寫訪問WMI類的客戶機腳本或應用程序,或者經過編寫WMI提供程序向WMI提供數據。有關更多信息,請參見使用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基礎設施與WMI提供者和託管對象之間的關係,還顯示了WMI基礎設施與WMI使用者之間的關係。

WMI Components(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存儲庫中。

  • 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存儲庫由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提供的。

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.

譯:在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和管理應用程序之間的全部通訊,因此基礎設施提供瞭如下特性

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

相關文章
相關標籤/搜索