Windows Management Interface (WMI)
Summary
- To access management information about hardware devices, operating system, network services, and software applications,
- utilities
such as
- VB Scripts called from Windows Scripting Hosts
- and C# and VB.NET apps
- make queries
in SQL-like WMI Query Language (WQL) syntax to the
- winmgmt.exe Windows Management service
"core" component within Microsoft operating systems.
- This service" in turn queries various WMI Providers which actually obtain information from items under their jurisdiction.
- For Active Directory information, the ADSI Extension remote interface IWMIExtension is not available for Windows Server 2003, which instead use Active Directory Service Interfaces (ADSI)
- WMI queries can be made to the WMI core service from within a variety of langagues
- The names of objects queried are defined in a repository
which
- is updated by the mofcomp.exe SDK utility which compiles
- Managed Object Format (MOF) statements based on the Interface Definition Language (IDL).
|
The Microsoft Windows Managment Service
The Windows Management service automatically starts when the first management application makes a call to connect.
Windows 2000 and XP offer more information than previous OS versions. Windows 2000 includes WMI version 1.5 (1085.005), which is SMBIOS aware. L.J. Johnson notes that accessing Win32_QuickFixEngineering class on a pre-SP3 version of W2K causes the WinMgmt process to hang at 100% processor activity. Also, the WMI object seems to incorrectly parse some of the QEF information in the registry, and provides duplicate data for many of the QEFs. This bug is fixed in a post SP2 QEF, and in SP3 for W2K, so it is advisable to use his code to abort the WMI calls if the machine is running W2K SP3 or above,
Private Function GetOS_
(ByVal xi_sWbemServices As SWbemServices) As Variant
Dim vntTmp As Variant
Dim vntRtn As Variant
ReDim vntRtn(1 To 2) As Variant
vntTmp = GetOsData(xi_sWbemServices)
If Left$(vntTmp(1, 13), 4) = "5.0." Then
If CLng(vntTmp(1, 25)) >= 3 Then
vntRtn(1) = True
vntRtn(2) = vbNullString
Else
vntRtn(1) = False
vntRtn(2) = "If you are running W2K, _
you must have at least SP3 to run this " & _
"method. You are running SP " & vntTmp(1, 25)
End If
Else
vntRtn(1) = True
vntRtn(2) = vbNullString
End If
GetOS = vntRtn
End Function
The "Windows Management Instrumentation Driver Extensions" service provides "systems management information to and from drivers."
|
|
|
|
|
|
|
|
|
from : http://www.wilsonmar.com/1wmiwbem.htm
microsoft.public... 
$40
Cscript "
浙公网安备 33010602011771号