hello,
I use the following code
in our logon to gather info.
works GREAT!
I also use norton system center to push out jobs
with same code,
when it runs the job, it runs as user "system"
But the script bombs out.
I am not sure if the impersonate thing is what
is problem is.
any help would be appreciated.
if this is off topic I apologize.
thanks
Adam
code:
BREAK ON
$Manufacturer = WMIQuery("Manufacturer","Win32_ComputerSystem")
$SystemModel = WMIQuery("Model","Win32_ComputerSystem")
$SystemSerialNumber = WMIQuery("SerialNumber","Win32_BIOS")
$CPUManufacturer = WMIQuery("manufacturer","Win32_Processor")
$SystemMemory = val(WMIQuery("TotalPhysicalMemory","Win32_LogicalMemoryConfiguration"))/1024
FUNCTION WMIQuery($what,$where,)
DIM $strquery, $objenumerator, $value
$strquery = "Select $what From $where"
$systemset = GetObject("winmgmts:{impersonationLevel=impersonate}!//@WKSTA")
$objenumerator = $systemset.execquery($strquery)
FOR EACH $objinstance IN $objenumerator
IF @error = 0 AND $objinstance <> ""
$=execute("$$value = $$objInstance.$what")
$wmiquery="$value"+"|"+"$WMIQuery"
ENDIF
NEXT
$wmiquery=left($wmiquery,len($wmiquery)-1)
EXIT @error
ENDFUNCTION
return