Thanks guys for the quick response.

Richard, I have used your function and it works fine on a stand-alone, but I don't get any processes returned when running it on a Terminal Server session. It's able to get the Session # (which was 8 in my case), but it doesn't list any processes. Do I need to change $strComputer or anything else. I'm very new to WinMgmt stuff, so any help would be appreciated.

Btw, this is the EnumProcess code I used for stand-alone machines :

Code:
Function EnumProcess($exe, optional $terminate, optional $Computer)
Dim $winmgmts, $ExecQuery, $Process, $id
Dim $GetObject
If NOT $computer $computer=@wksta EndIf
$winmgmts="winmgmts:{impersonationLevel=impersonate}!//$COMPUTER"
Select
Case Val($exe)>0
$ExecQuery="select * from Win32_Process where ProcessId='$exe'"
$GetObject=GetObject($winmgmts).ExecQuery($ExecQuery)
For Each $Process in $GetObject
If $terminate $=$Process.Terminate EndIf
$EnumProcess = $Process.name
Next
$GetObject=''
Case VarType($exe)=8
$ExecQuery="select * from Win32_Process where Name='$exe'"
$GetObject=GetObject($winmgmts).ExecQuery($ExecQuery)
For Each $Process in $GetObject
If $terminate $=$Process.Terminate EndIf
$id=$Process.ProcessId
$EnumProcess = "$Id" + "|" + "$EnumProcess"
Next
$EnumProcess=Left($EnumProcess,Len($EnumProcess)-1)
$GetObject=''
Case 1
Exit 1
EndSelect
EndFunction