hi all,

is there is someone who knows how to retrieve the owner of a process using wmi ?
I've done the following but it doesn't work....
------------------------------------------------------------
FUNCTION ViewProcess($Host)

$objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $Host + "\root\cimv2")
$WSql = "SELECT * FROM Win32_Process"

$colProcess = $objWMIService.ExecQuery($WSql)

FOR EACH $process IN $colProcess
? $Process.Name
$ReturnVal = $process.GetOwner($strUser, $strDomain)
IF ReturnVal = 0
? $strUser
? $strDomain
ENDIF
NEXT

ENDFUNCTION
------------------------------------------------------------
$strUser and $strDomain stays empty...:(

someone an idea ?

thanks for help...