I would like to deterimne the PID of a process based on the user name and image name. It dosen’t look like there are built in inspectors for user name of a process, has anyone had any luck doing this? I need to determine the PID to terminate a process that could have several instances running under different user names.
I can’t find a way to pull that information from WMI, there is no property for user under the Win32_Process class. There is a creation method called “GetOwner” that should provide the user, but I’m not sure if I can use that in a WMI query. Can you post an example please?