ValidateQuery Method in Class SMS_CollectionRuleQuery

The ValidateQuery Windows Management Instrumentation (WMI) class method, in Configuration Manager, verifies that the query collection rule is a valid WQL or Extended WQL statement.

The following syntax is simplified from Managed Object Format (MOF) code and defines the method.

Syntax

Boolean ValidateQuery(  
     String WQLQuery  
);  

Parameters

WQLQuery
Data type: String

Qualifiers: [in]

Query statement to validate.

Return Values

A Boolean data type that is true if the query is validated.

Remarks

Your application calls this method before adding a query rule to a collection. An invalid query rule results in no members being added to the collection for that query. This can be misleading and hard to debug.

In addition to being syntactically correct, the query rule must specify resource class names in the FROM clause. For example, the FROM clause must specify SMS_R_System Server WMI Class, SMS_R_User Server WMI Class, SMS_R_UserGroup Server WMI Class, or a user-defined resource class name.

Requirements

Runtime Requirements

For more information, see Configuration Manager Server Runtime Requirements.

Development Requirements

For more information, see Configuration Manager Server Development Requirements.