Jump to content

Get and kill process PID when you know the username and process name

Recommended Posts

I hoping some of you young people can help an old man get off the nickel...  I have a small project I'd like to complete before I retire.  My problem is that on a terminal server environment I need to be able to detect the PID of a process by 'process name' AND 'process owner' so I can kill that specific process and not affect others who may be running the same process in another session.    I can seem to do one or the other but not both.  Can anyone please point me in the right direction?  Thanks very much in advance. -Glen

Link to comment
Share on other sites

I may be talking above my level, but if you have the capacity to detect the PID by the process name and detect the process owner - both of which I found example scripts, the way to implement killing a specific instance of that PID without affecting other kiosks would be to install an executable that is made into a service that receives TCP flags signaling to kill the process on that particular node that is determined to be disabled. On your server, you would have to set up a TCP transmitter that would send out the flag to the receiver. I have seen this work in AutoIt example scripts in the past. I'm not experienced enough to write such code on my own, but I understand the concept and can work from example scripts. I hope this can help point you in the right direction. Hopefully, someone more experienced can help you even more.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...