$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$user='';юзверь на удалённой машине
$pasw='';его пароль
$comp='';сетевое имя компьютера
$procesname='winlogon.exe';имя процесса
If Ping($comp)=0 Then Exit
$cre = ObjCreate("WbemScripting.SWbemLocator")
$obj=$cre.ConnectServer ($comp, "root\cimv2", $comp&"\"&$user, $pasw)
$obj.Security_.ImpersonationLevel = 3
$que=$obj.ExecQuery("Select * from Win32_Process where caption='"&$procesname&"'")
$res=''
For $o In $que
$res&='время запуска:'&$o.creationdate&'; PID:'&$o.handle&'; приоритет:'&$o.priority&@CRLF
Next
If $res<>'' Then MsgBox(0,'',$res)
$oMyError = 0
Func MyErrFunc()
MsgBox(4096, "AutoItCOM Test", "We intercepted a COM Error !" & @CRLF & @CRLF & _
"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & hex($oMyError.number, 8) & @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext)
Exit 1
EndFunc