Shawn,

Did some playing around with your script and have the following result:
[quote]
Script error : unknown command !
$wmiselect = $wmi.execquery($$query)
[quote]

Here is code as it stands now:

code:

BREAK ON
CLS
$myarray = Split("SERVER1~~SERVER2", "~~")
FOR EACH $element IN $myarray

FOR EACH $disk IN Split(WmiSelect("FreeMegabytes","Win32_PerfFormattedData_PerfDisk_LogicalDisk",$element),"|")
? "Free Space is = "val($disk) / 1048576 " MB"
NEXT
FOR EACH $disk IN Split(WmiSelect("AvgDiskQueueLength","Win32_PerfFormattedData_PerfDisk_LogicalDisk",$element),"|")
? "Average Diskqueue Length = "$disk
NEXT
? "Percent Processor Time = "WmiSelect("PercentProcessorTime","Win32_PerfRawData_PerfProc_Thread",$element)
? "SQL Server Buffer Hit Cache Ratio = "WmiSelect("Buffercachehitratio","Win32_PerfRawData_MSSQLSERVER_SQLServerBuffer",$element)
NEXT


;$wmi = GetObject("winmgmts:root/CIMV2")
;$strQuery = "select * from CIM_StatisticalInformation"
;$result = $wmi.ExecQuery($strQuery)

function WmiSelect($what,$where,$element)

dim $wmi
$query = "Select $what From $where"
$wmi = getobject("winmgmts:{impersonationlevel=impersonate}!//"+$element+"\root\cimv2")

$wmiselect = $wmi.execquery($$query)

endfunction


Thanks!

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's