Hi guys,

Has anyone messed with SMS Variant Arrays returned by WMI? I can't seem to figure this out:

$Resource = GetObject("winmgmts:\\{server}\root\sms\site_{site}:SMS_R_System.ResourceID=258")
? @SERROR
? VarType($Resource.IPAddresses)

Produces this output:

----------------------------
The operation completed successfully.

ERROR : invalid method/function call: missing ')'!
Script: C:\Scripting\SMS Scripts\WMI Resource Records.kix
Line : 3
----------------------------

And this code:

$Resource = GetObject("winmgmts:\\{server}\root\sms\site_{site}:SMS_R_System.ResourceID=258")
? @SERROR
? Cstr($Resource.IPAddresses)

Produces this result:

--------------------------------------------
The operation completed successfully.

ERROR : Error in expression: this type of array not supported in expressions.!
Script: C:\Scripting\SMS Scripts\WMI Resource Records.kix
Line : 3
---------------------------------------------

The call to WMI should be returning an array of variants, but kix can't seem to understand...

Microsoft suggests using a function to convert in this instance, but I cannot find the function or how to do it in Kix. See
http://msdn.microsoft.com/library/en-us/sms/hh/sms/usingsms_850l.asp

Please help!