White Papers

8 No Restrictions | Filter Dialects |
</wsman:SelectorSet>
</w:Filter>
</n:Enumerate>
</s:Body>
</s:Envelope>
2.3 Query Languages (CQL and WQL)
CQL (CIM Query Language) and WQL (Windows Management Instrumentation Query Language) are
languages derived from SQL with minor semantic changes. In WS-Man, both Enumeration and subscription
can use the query languages to select a particular instances of a class. CQL is a DMTF standard and WQL
is a Microsoft’s implementation of CQL. Familiarity with the syntax of SQL will ease the use of CQL or WQL.
The query languages can be used as part of any WS-Man enumeration or subscription call.
2.3.1 Enumeration and Query Languages
You can use the CQL in an enumeration as follows.
winrm e cimv2/DCIM_NICView -u:<userid> -p:<password> -r:https://<ip>/wsman -
a:basic -encoding:utf-8 -skipCACheck -skipCNCheck -
dialect:http://schemas.dmtf.org/wbem/cql/1/dsp0202.pdf -filter:"select * from
DCIM_NICView WHERE SlotLength='0004”"
You can use the WQL in an enumeration as follows,
winrm e cimv2/DCIM_MemoryView -u:<userid> -p:<password> -r:https://ip/wsman -
SkipCNcheck -SkipCAcheck -encoding:utf-8 -a:basic -
dialect:http://schemas.microsoft.com/wbem/wsman/1/WQL -filter:"select * from
DCIM_MemoryView WHERE BankLabel='A'"
The commands are similar except for the specified dialect (highlighted). The CQL specifies the DMTF
specification as the dialect, whereas the WQL uses a different dialect.
The above commands return the same output as the SelectorFilter (described in Section 2.1). However,
the query language provides more options to set the conditions. The CQL and WQL can be used
interchangeably. Users familiar with WMI will prefer to use WQL whereas CQL is traditional CIM query
infrastructure defined as a DMTF specification.
To find out about the possible query strings, refer to the CQL and WQL specification.
For details on CQL, go to