SMS_Query

The SMS_Query WMI class is a class that serves as a container for predefined queries.

The following syntax is simplified from MOF code and includes all inherited properties.

Class SMS_Query : SMS_BaseClass
{
  string QueryID;
  string Name;
  string Comment;
  string Expression;
  string TargetClassName;
  string LimitToCollectionID;
};

Properties

  • QueryID
    Data type: string
    Access type: Read-only
    Qualifiers: Key

    Unique, auto-generated value.

  • Name
    Data type: string
    Access type: Read/write

    Name of the query as shown in the console.

  • Comment
    Data type: string
    Access type: Read/write

    Provides comments to document the query.

  • Expression
    Data type: string
    Access type: Read/write

    WMI Query Language (WQL) text.

  • TargetClassName
    Data type: string
    Access type: Read/write

    Use the name of the class found in the FROM clause of the query. The name you use is arbitrary for queries that perform a join. The console uses this property value for display purposes to give the user an idea of the data that the query returns.

  • LimitToCollectionID
    Data type: string
    Access type: Read/write

    Use to limit the query results to those resources which are members of the collection.

Remarks

You can use SMS_Query to persist valid queries that can be used later in an application or that can be run from the SMS Administrator Console.

Instances whose TargetClassName is set to SMS_StatusMessage appear under the System Status node in the console. All other instances appear under the Queries node.

For an example that creates a persisted query, see Adding Carpool Discovery Data to the SMS Administrator Console.

See Also

Resource Management Classes, SMS_Collection