<< Click to Display Table of Contents >> Raynet One > 1.1 > User Guide > Technical overview Custom WMI queries |
On Windows systems, information about the operating system and its components is stored in big hierarchies. In the WMI technology, information objects are grouped into namespaces. Very similar, concept-wise, is the Windows registry. It is a graph of directories and leaf nodes. There are paths to nodes deep into the hierarchy containing special information. The properties of information names are stored as key-value pairs. The key is a sequence of characters. The value can be of multiple types: integral, boolean or a sequence of characters. While the prior list is neither complete nor specific enough, the actual available type list is known to the technical crowd.
To find out more about the available information objects, check out Microsoft's documentation.
Due to the richness and availability of the WMI technology on Windows systems, it is the method of choice for Zero Touch Windows device inventory. Fetching data from Windows systems using WMI does not leave-behind persistent files. Special programs do not have to be uploaded to the target system. The Windows operating system itself provides services offering remote protocols for WMI queries.
We support various WMI class layouts for database integration. Objects are stored in predefined database table layouts. Custom properties not matching any predefined layout column are moved into an opaque CustomProperties store for future integration/handling.
Note: |
The Custom queries input box of the Zero Touch Windows Device Scan instrument settings, of the Windows Zero Touch Inventory plugin. The text highlighted in blue is the example WMI query. The input box expects a valid JSON definition (rejection on validation failure).
The same notation is used for both registry and WMI queries. The query object is part of a JSON list.
At least WmiClassName has to be provided.
Describes the key name found in the key-value relations of the queried objects. The key's value is treated as the special name of the database object. Registry queries treat this name differently than WMI queries.
Default: Name
The name of the queried object class layout. It should match one of the supported WMI classes. It specifies the expected property layout for database integration.
If the WQL is not provided, all WMI objects of the WmiClassName are queried, including all of their properties. Otherwise, in good recommendation, the name of the query's source, as put in the FROM clause, should match this value.
Mandatory.
The query to execute for data fetching. If a basic WMI query is requested and the WQL is not provided, all WMI objects of WmiClassName are requested. If a registry query is requested, the WQL is mandatory (the registry key path).
Optional if WMI, mandatory if registry.
Defines the location of the WMI objects of interest. For registry queries, this value denotes the Windows registry hive. See Microsoft's documentation for further details on WMI namespaces and registry hives.
Default (registry): HKEY_LOCAL_MACHINE
Default (WMI): \root\cimv2
Decides the seriousness of the error handling in the case of failed queries. If true, the entire operation on all specified queries will fail on this single query's failure.
Default: false
Decides the type of query. If true, the registry is queried. Otherwise, the WMI database is queried.
Default: false
Does only apply for registry queries. By default, properties from the key directly at the key path are included. If set to true, those properties are excluded. Properties from registry keys further down the registry tree are always included.
Default: false
Filters the properties of interest from the ones contained in the query's result. The properties can be mapped to different keys in the resulting database object. If not provided, all properties are taken as they exist.
Optional.
At least one of SourceName or TargetName properties have to be provided.
The property key in the queried result. If not provided, the TargetName is taken instead.
The property key in the final database object. If not provided, the SourceName is taken instead.
[
{
"WmiClassName": "Win32_ComputerSystem",
"Fields": [
{ "SourceName": "Name" },
{ "SourceName": "Model" },
{ "SourceName": "Manufacturer" }
]
},
{
"WmiClassName": "Win32_OperatingSystem",
"WQL": "SELECT Name, Caption, BuildNumber FROM Win32_OperatingSystem"
}
]
The above JSON list contains two query definitions, written as JSON objects with key-value pairs. The first query definition looks for all instances of Win32_ComputerSystem and selects their fields named Name, Model and Manufacturer. The second query definition looks for all instances of Win32_OperatingSystem on the machine by using a custom WMI query in the WQL parameter.