Read-IndexedWmiObject

The command reads the values of properties of the n-th instance of a WMI class and stores these values in variables. This enables the specific query of available system and software components.


Settings:

  • Namespace
    Specifies the namespace to which the connection is to be made and in which the class (object) is located. This value is also set using the WMI browser. The default namespace is \\.\root\CIMV2.

  • Object path
    This is the relative path within the namespace and corresponds to the class name for which the number of existing instances on the system is to be determined. This value is also set using the WMI browser.
  • Instance number
    Index that specifies which of the instances found is to be used. The index is zero-based, that is, the first instance has the instance number 0.
  • Variable prefix
    Together with the property names, this entry results in the actual variable name, i.e. the prefix is placed in front of the variable name.
  • Properties
    Names of properties selected in the WMI Browser. Each line together with the variable prefix results in a variable. The value of the variable is determined at runtime when the script is executed.


Example:

The following example reads the values of the properties Manufacturer, Caption and Description of the 1st instance from the class Win32_BIOS and stores them in variables of the same name with the prefix _WMI. The variables _WMIManufacturer, _WMICaption and _WMIDescription filled with the respective values are then available within the script:


Corresponds to DSM eScript command:

  • WMIGetIndexData


See also: