Upravit

Sdílet prostřednictvím


WMI System Properties

Windows Management Instrumentation (WMI) defines a set of system properties that are associated with all classes and instances of classes. As with system classes, system property names begin with a double underscore, distinguishing them from properties created by applications or providers that must not start with a single or double underscore. Another way to identify a system property is to use the IWbemClassObject::Get method.

System properties are available at any time, but values might be NULL. NULL indicates a property does not apply to a specific object. However, system properties might not be available all the time for all classes or instances.

System Properties

The following list describes the WMI system properties. The examples given are taken from the system properties of the Win32_OptionalFeature class, which is described at the bottom of this topic.

__Class

Data type: CIM_STRING

Access type: Read-only for instances; read/write for classes

The name of the class.

Example: Win32_OptionalFeature

__Derivation

Data type: CIM_STRING array

Access type: Read-only for both instances and classes

Class hierarchy of the current class or instance. The first element is the immediate parent class, the next is its parent, and so on; the last element is the base class.

Example: {CIM_LogicalElement, CIM_ManagedSystemElement}

__Dynasty

Data type: CIM_STRING

Access type: Read-only

Name of the top-level class from which the class or instance is derived. When this class or instance is the top-level class, the values of __Dynasty and __Class are the same.

Example: CIM_ManagedSystemElement

__Genus

Data type: CIM_SINT32

Access type: Read-only

Value that is used to distinguish between classes and instances. This value is WBEM_GENUS_CLASS (1) for classes, and WBEM_GENUS_INSTANCE (2) for instances and events.

Example: 2

__Namespace

Data type: CIM_STRING

Access type: Read-only

Name of the namespace of the class or instance.

Example: root\cimv2

__Path

Data type: CIM_STRING

Access type: Read-only

Full path to the class or instance—including server and namespace.

Example: \\MyServer\root\cimv2:Win32_OptionalFeature.Name="TelnetClient"

__Property_Count

Data type: CIM_SINT32

Access type: Read-only

Number of nonsystem properties defined for the class or instance.

Example: 6

__Relpath

Data type: CIM_STRING

Access type: Read-only

Relative path to the class or instance.

Example: Win32_OptionalFeature.Name="TelnetClient"

__Server

Data type: CIM_STRING

Access type: Read-only

Name of the server supplying the class or instance.

Example: MyServer

__Superclass

Data type: CIM_STRING

Access type: Read-only

Name of the immediate parent class of the class or instance.

Example: CIM_LogicalElement

The following PowerShell code retrieves the properties of the Win32_OptionalFeature class, which includes the system properties.

Get-WmiObject win32_OptionalFeature | Where-Object {$_.name -eq "TelnetClient"}

The previous code sample returns the following:

__GENUS          : 2
__CLASS          : Win32_OptionalFeature
__SUPERCLASS     : CIM_LogicalElement
__DYNASTY        : CIM_ManagedSystemElement
__RELPATH        : Win32_OptionalFeature.Name="TelnetClient"
__PROPERTY_COUNT : 6
__DERIVATION     : {CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER         : myServer
__NAMESPACE      : root\cimv2
__PATH           : \\myServer\root\cimv2:Win32_OptionalFeature.Name="TelnetClient"
Caption          : Telnet Client
Description      : 
InstallDate      : 
InstallState     : 2
Name             : TelnetClient
Status           : 
PSComputerName   : myServer