I'm little new to world of WQL (WMI Query Language). I'm trying to query ConfigMgr 2012 using WQL but I'm facing an error when I try to mention the name of a column in the comma separated select clause. The error happens only when the column being fetched is of array type and contains null values. It works fine if the array column has some values. The same works fine even if column is of non-array type (string, int, etc.) with null values. I've elaborated the sample queries below.
When I fire following query it works well :
Query # 1 :
SELECT * from SMS_PROGRAM
But when I fire following query it doesn't work:
Query # 2 :
SELECT PackageID, SupportedOperatingSystems from SMS_PROGRAM
It gives below error:
(GenericFailure) with error code number 0x80041001
Here SupportedOperatingSystems property is null for all the records that come in the result set containing 7 records. This property is an array containing objects of SMS_OS_Details class. I've got these details using wbemtest tool. I request if any one has come across this issue then please help.
I got an answer from one of my colleagues in my company. This was his reply:
You get the NULL specifically because it is a lazy property. You cannot include a lazy property in WQL select query. You must use an asterisk (*) and then parse the object.
To know more about lazy properties and how to read them please follow the below mentioned link:
http://msdn.microsoft.com/en-us/library/jj218055.aspx
The property SupportedOperatingSystems has been defined as lazy in the MSDN documentation as mentioned below :