Error while fetching null valued array columns in WQL (WMI Query Language)

0

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) and contains 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 results in error:

Query # 2 : SELECT PackageID, SupportedOperatingSystems from SMS_PROGRAM

(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 any help will be greatly appreciated.

wmi-query
sccm
wql
asked on Stack Overflow Mar 31, 2014 by RBT • edited Dec 8, 2017 by RBT

1 Answer

0

I got an answer from one of my colleagues in my company. This is what he replied me with:

"You get the NULL specifically because it is a lazy property. You simply cannot include a lazy property in your select query the way you are doing it. You must use * and then parse the object."

What is a lazy property 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 :

http://msdn.microsoft.com/en-us/library/cc144361.aspx

answered on Stack Overflow Apr 1, 2014 by RBT • edited Dec 8, 2017 by RBT

User contributions licensed under CC BY-SA 3.0