/build/static/layout/Breadcrumb_cap_w.png

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
  • This might help you get started. It is Powershell though.

    (Get-WmiObject -class Win32_Process | Where-Object {$_.Name -eq 'iexplore.exe'}) | ForEach-Object {$_.GetOwner()} | select -expand user - flip1001 10 years ago

Answers (1)

Posted by: SMal.tmcc 10 years ago
Red Belt
0

here is the table for the Win32_process class

http://msdn.microsoft.com/en-us/library/aa394372(v=vs.85).aspx

 

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ