How to get Process Name and User Name in one WMI ExecQuery?
I'm having hard time on filtering a certain process that is running by a specific user. e.g Administrator/SYSTEM
strProcessName = "iexplore.exe"
Set colListOfProcess = objWMIService.ExecQuery("Select * from Win32_Process Where Name ='" & strProcessName & "'")
but how can I insert the username for this query. do you know where to get the table of win32_process?
1 Comment
[ + ] Show comment
Answers (1)
Please log in to answer
Posted by:
SMal.tmcc
11 years ago
(Get-WmiObject -class Win32_Process | Where-Object {$_.Name -eq 'iexplore.exe'}) | ForEach-Object {$_.GetOwner()} | select -expand user - flip1001 11 years ago