Overview
Execute a given WQL (WMI Query Language) query on the local system. This command provides direct access to WMI data through custom queries, offering maximum flexibility for data extraction and analysis.ACLs are applied at the object class and instance level, so query results may vary depending on your privileges.
Syntax
Parameters
The WQL query to execute (must be properly quoted)
The WMI namespace to query (default: “root\CCM”)
Examples
WQL Syntax Reference
Basic SELECT Statement
Basic SELECT Statement
- Use
*to select all properties - Specify individual properties separated by commas
- Use WHERE clause for filtering
WHERE Conditions
WHERE Conditions
Advanced Operators
Advanced Operators
- LIKE - Pattern matching with wildcards (% and _)
- IS NULL / IS NOT NULL - Check for null values
- AND / OR - Combine conditions
- IN - Match against a list of values
Common SCCM WQL Queries
Output Format
Query results are displayed in a structured format:Use Cases
Custom Data Extraction
Custom Data Extraction
Create targeted queries to extract specific information not available through other SharpSCCM commands.
Advanced Reconnaissance
Advanced Reconnaissance
Combine multiple properties and conditions to build comprehensive intelligence about the SCCM environment.
Troubleshooting and Analysis
Troubleshooting and Analysis
Query specific WMI classes to diagnose client issues or understand configuration details.
Error Handling
Related Commands
local classes- List available WMI classes for queryinglocal class-properties- Get properties for query planninglocal class-instances- Simplified class querying with built-in options