Newsreel
Products & Services
Web Watch
Software Update Resource Directory
Events Diary
Articles
The Magazine
Subscribe
Contact Us
Advertisers
TechEd reports
Exhibitors
Fun stuff |

Windows Management Instrumentation
July 8 - A star of this TechEd is certainly Windows Management Instrumentation. WMI is going to
become one of the hottest TLAs of the summer. WMI is Microsoft's implementation of Web-Based Enterprise Management
(WBEM), which is a standardised technology for providing enterprise system managers with a
standard, low-cost solution for their management needs. WMI is based on two core
components: the actual WMI manager (WinMgmt.exe), the gate for programmatical access to
management data, and the Common Information Model (CIM) repository, a central storage area
for that management data.
WMI is strictly tied to two other Microsoft's technologies in the area
of system management: MMC and WSH. The former provides an infrastructure to build a
uniform console to present management information, whereas the latter makes available
scripting capabilities to access such information programmatically.
What You Get with WMI
WMI provides you with a consistent representation of the Windows 98 and Windows 2000
system, plus a COM and scripting API to interrogate them and get the information that's
needed. Furthermore, you have a flexible architecture that allows third-party vendors to
extend the information model to cover new devices, applications, and other enhancements by
writing code modules (WMI providers). Given this, WMI sounds like a sort of Windows
esperanto for system administering and information retrieval. The secret hope is that with
WMI the gloomy days, when being able to access system information was a sign of power, are
definitely gone.
WMI comes with an event architecture capable of detecting and
forwarding changes in the system. Once a new hardware is WMI compatible (this can be done
through extensions to its WDM driver) it integrates well and can communicate with all the
rest of the Windows management system. To better understand the essence of WMI, think of
OLE DB. It features the same pattern, universal access to information, that you find in
WMI.
The WMI SDK comes with a few system-provided providers: Registry
Provider, Windows NT Event Log Provider, Win32 Provider, SNMP Providers, and WDM Provider.
WMI and Scripting
To facilitate information retrieval, WMI supports a query language which is similar
to SQL (another indirect sign that OLE DB taught a lot
):
Select TotalPhysicalMemory From
Win32_LogicalMemoryConfiguration
Another script example of WMI to get all the running processes is:
Set obj = GetObject
("winmgmts:{impersonationLevel=impersonate,(Debug)}") .InstancesOf
("win32_process")
for each Process in obj
WScript.Echo Process.ProcessId, Process.name
next
Summary
WMI is a powerful script-based service, but it can be fairly complex when you're just
getting started. However, with it you can do via script pretty complicated and somewhat
incredible things, such as kill processes or reboot machines.
Dino Esposito
|
|