The ValidateQuery Windows Management Instrumentation (WMI) class method, in System Center 2012 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.
Boolean ValidateQuery( String WQLQuery );
- Data type: StringQualifiers: [in]Query statement to validate.
A Boolean data type that is true if the query is validated.
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.
For more information, see Configuration Manager Server Runtime Requirements.
For more information, see Configuration Manager Server Development Requirements.