`
yanzilee9292
  • 浏览: 538381 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

WMI(windows Management Instrument)架构

 
阅读更多

编程获取或者写入操作系统的信息, 只需要关注WMI consumers这一层.  通过C/C++之外的语言, 就仅仅考虑 COM API for WMI or the Scripting API for WMI 这两种方式的第二种. 

 

Example: 通过ruby获取操作系统的版本信息, 采用Scripting API for WMI 这种方式

 

WIN32OLE.connect('winmgmts:\\\\.').ExecQuery("select * from Win32_OperatingSystem" ).each do |m| 
p "#{m.Caption} SP#{m.ServicePackMajorVersion}" 
end 
 

 

 

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.

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.

 

 

 

 

 

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 classStdRegProv, 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 infrastructure

    The WMI infrastructure is a Microsoft Windows operating system component. The WMI infrastructure has two components: the WMI service (winmgmt), including 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, seeMonitoring Events.

  • WMI consumers

    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.

分享到:
评论

相关推荐

    Windows Management Instrumentation(WMI):常见问题

    6: 为什么我的脚本可以在某个版本的 Windows 上运行,但在另外一个版本的 Windows 上却不能运行? 7:为什么 WMI 操作返回一个错误? 8:WMI 不工作。如何解决这个问题? 9:如何设置 WMI 命名空间的安全性? ...

    Golang 获取wmi windows硬件信息

    这是一个Golang 获取wmi windows硬件信息的源代码,包括CPU,网卡,内存,硬盘等信息

    基于 WMI(Windows Management Instrumentation)的 BIOS 接口设计<固件 C 字营>C

    基于 WMI(Windows Management Instrumentation)的 BIOS 接口设计 <固件 C 字营>Cstyle_x007 WMI 是 Windows 操作系统管理数据和操作的基础设施,系统管理员可以使用 VB Script、PowerShell 及 Windows API(C++、...

    Windows Management Instruction的介绍及应用

    **Windows Management Instruction(WMI)**是微软提供的一种管理和配置Windows操作系统的重要工具,它基于行业标准的Web-Based Enterprise Management(WBEM)框架。WMI允许系统管理员、开发人员以及各种应用程序...

    [MS-WMI]: Windows Management Instrumentation Remote Protocol

    Windows Management Instrumentation (WMI) Remote Protocol is a Distributed Component Object Model (DCOM), as specified in [MS-DCOM], a client/server–based framework that provides an open and automated...

    linux环境如何通过wmi访问windows

    在这种情况下,Windows Management Instrumentation(WMI)提供了一个接口,允许其他系统(包括Linux)查询和控制Windows系统。本文将详细介绍如何在Linux环境中通过WMI访问Windows系统。 首先,理解WMI:WMI是微软...

    wmi.rar_C# WMI_windows wmi_wmi_wmi proerties

    Windows Management Instrumentation(WMI)是Windows操作系统提供的一种管理和配置计算机环境的方法。它允许应用程序通过标准接口访问系统信息,如硬件状态、软件设置、网络配置等。C#作为.NET框架的一部分,提供了...

    WmiTools(windows系统工具)

    WMI是Windows Management Instrumentation的缩写,它是Windows操作系统中的一个标准管理架构,允许管理员和其他应用程序获取关于系统状态的信息,包括硬件、软件、网络和安全等方面的数据。WMI基于Web-Based ...

    Elements of Windows Management Infrastructure (WMI) - 2页

    Windows Management Infrastructure (WMI)是微软为Windows操作系统提供的一种管理和自动化技术,用于收集、存储和操作系统的各种管理信息。WMI允许系统管理员、开发者以及应用程序通过标准接口来访问和操作系统的...

    Microsoft - Windows Scripting With Wmi(2007)

    《Microsoft - Windows Scripting With Wmi(2007)》是关于Windows Management Instrumentation(WMI)技术的一本PDF教程,旨在帮助IT专业人士深入理解和掌握利用WMI进行Windows脚本编程的技术。WMI是微软提供的一种...

    使用j-Interop实现java连接wmi获取windows系统信息的例子

    在IT领域,尤其是在系统管理和监控方面,Windows Management Instrumentation(WMI)是一个强大的工具,它提供了访问和管理Windows操作系统及应用程序的接口。而Java开发者有时需要在Java程序中获取Windows系统的...

    Windows Management Instrumentation (WMI) Tools reference

    chm文件类型,英文版,主要讲述用WMI工具管理Windows 的步骤及原理.适用于高级windows系统管理员.

    Windows Instrumentation WMI and ACPI

    Windows Management Instrumentation(WMI)是微软Windows操作系统中的一种核心组件,它为管理系统提供了一种标准化的方法。WMI允许应用程序和脚本语言获取有关系统硬件、软件和服务的信息,以及执行各种管理任务。...

    windows事件ID10,WMI错误的解决方法

    Windows事件ID10是Windows操作系统中与Windows Management Instrumentation(WMI)服务相关的一个常见问题。WMI是Windows操作系统的核心组件,它允许管理员和其他应用程序通过标准接口获取和修改系统配置信息,监控...

    Windows Management Instrumentation (WMI)的英文开发文档

    概述: WMI 文档的首页通常提供 WMI 的基本概念、功能和使用方法。 2. WMI 基本概念 WMI 体系结构: 介绍 WMI 的基本结构,包括提供程序、存储库和客户端应用程序之间的关系。 对象模型: 讲解 WMI 中的类、实例、属性...

    WMI.rar_C# WMI_WMI WIN32_process.z_windows wmi_wmi

    标题"WMI.rar_C# WMI_WMI WIN32_process.z_windows wmi_wmi"中,核心关键词是"C# WMI",表明这是一个关于使用C#编程语言来操作Windows Management Instrumentation(WMI)的示例,其中可能涉及到WIN32_process接口。...

    windows WMI 脚本教程

    Windows Management Instrumentation(WMI)是一种基于业界标准的管理支持技术,能够访问、配置、管理和监视所有的 Windows 资源。WMI 于 1998 年作为一个附加组件与 Windows NT 4.0 Service Pack 4 一起发行,是...

    WMI信息VB脚本生成器.exe

    WMI简述:WMI是Windows Management Instrumentation (Windows管理工具)的缩写,是内置在 Windows 2000、Windows XP 和 Windows Server 2003 系列操作系统中核心的管理支持技术。 具体说来,WMI的本领如下: 1.获取...

Global site tag (gtag.js) - Google Analytics