顯示具有 Windows WMI 標籤的文章。 顯示所有文章
顯示具有 Windows WMI 標籤的文章。 顯示所有文章

2014年7月4日 星期五

WMI First using sample:Method 2:To connect to WMI and retrieve an object using a moniker --- Creating a Registry Key Using VBScript

WMI monikers can consist of three parts: one mandatory component and two optional components. The mandatory component is the "winmgmts:" prefix.
All WMI monikers must begin with "winmgmts:" as shown here:
Set objSWbemServices = GetObject("winmgmts:")
After you have obtained a reference to SWbemServices, you can then invoke one of the object methods as shown here:
Set colSWbemObjectSet = objSWbemServices.InstancesOf("Win32_LogicalDisk")

Step 1write the vb script as following, and save it as "NEW_RegistryKey.vbs"

WMI First using sample:Method 1: To connect to WMI using SWbemLocator--- Creating a Registry Key Using VBScript

You can use the methods of the SWbemLocator object to obtain an SWbemServices object that represents a connection to a namespace on either a local computer or a remote host computer. You can then use the methods of the SWbemServices object to access WMI.
You can use the methods of an SWbemServices object to perform operations against a namespace on either a local host or a remote host. This object cannot be created by the VBScript CreateObject call.

Step 1write the vb script as following, and save it as "NEW_RegistryKey.vbs"

2014年6月30日 星期一

Windows WMI的架構簡介

Windows Management Instrumentation (WMI)management data和操作Windows-based (OS)operating systemsinfrastructure 可以寫WMI scriptsapplications來自動化管理remote computers,但是WMI也支援operating system的其他部分和其他產品,如System Center Operations Manager、早期的Microsoft Operations Manager (MOM)Windows Remote Management (WinRM)

下圖顯示WMI infrastructure WMI providers and managed objects的關係,並且顯示WMI infrastructureWMI consumers之間的關係。
 WMI infrastructureWMI service (Winmgmtoperating system component)作為 management applicationsWMI data providersmediator he WMI repository 是一個WMI-related static data storage area
management application script 呼叫連接到一個WMI namespaceWMI service 開始執行。 WMI service經由COM interface management applications互動。