I can find the classes a WMI host supports using a WQL query of
SELECT * FROM meta_class
This returns the classes and their methods and properties. These seem to be all strings. I'm trying to do some discovery and while having the property names is nice, getting the types of the properties would be even better. Is it possible to get the types of the properties?
For example, if the above query returns the class CIM_Processor
with a property of Family
can I tell that Family
is a uint16
rather than say a uint32
or a string
?
I've been reading through Retrieving Class Definitions but can't seem to find a query that returns types. Is this even possible? Is there a workaround not using WQL?
I'm not aware of the existence of a WMI class which retrieves the properties types. But you can enumerate the properties of a WMI class using the SWbemPropertySet
object and then access each property of the collection( SWbemProperty
) and read the value of the SWbemProperty.CIMType
property. If you are using .Net you can access the same information using the PropertyData
Class and the Type
Property.