#92676 - 2003-08-25 01:35 AM
Array of Variants -- VarType Error
|
The Chef
Fresh Scripter
Registered: 2003-01-08
Posts: 23
Loc: New Jersey
|
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!
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 483 anonymous users online.
|
|
|