Hm. I'm not aware of a way to get the process owner. You can certainly
find the process using the static Process.GetProcesses() or
Process.GetProcessByName() methods, and you can determine the machine it's
running on using the MachineName property of a particular Process instance.
From there, I suppose you'd have to have access to the running machine's
Active Directory and find some way to track down process ownership from
there.
If you don't really need to know who the owner is, but just whether YOU own
it or not, you can perhaps find some non-destructive method call against a
Process instance that is disallowed for non-owners, and execute it in a try
block. I know that Kill() and Close() require that you have ownership, but
obviously those wouldn't be methods you'd call to test if you have
ownership. Maybe an attempt to read the Threads collection or something
like that.
Just some random ideas that might suggest an avenue of exporation for you.
--Bob
"Moses M" <Mm*****@msn.com> wrote in message
news:et**************@TK2MSFTNGP11.phx.gbl...
I posted this a short while ago , but I don't think I explained the
problem clearly. Task Manager lists processes running on a local system, including
a "user name" associated with each process (e.g. SYSTEM). My application
needs to check if a particular process is running, and if so get the
associated "owner". I am really trying to determine the security context
in which the process was started. Thanks for any input.
-- Moses