How to get the actual user name / owner associated with a process.
I tried using process.StartInfo.EnvironmentVariables(“USERNAME”).
But this is returning the current user name of windows login account.
I want to get the owner associated with the process.
Can someone help me.
As per the UiPath studio, it is capturing the device ID of every machine and whenever we want to run the process, we must login into the machine and we need to provide the credentials. So, if we are running a process, the one who logged into will be the owner of the process. And the one you mentioned above will return that.
Can you please explain what you mean by the process associated owner?
My requirement is to kill all Excel process associated with the current user.
So when I am using this check, process.StartInfo.EnvironmentVariables(“USERNAME”), It is not giving me the actual owner of the process. But it is showing the owner as the current user and it will throw an exception saying : Could not kill the process.
I am getting the process list using ‘Get processes’ activity. It list out all the process in the server system(of current user and other users of the server)
You can set the ContinueOnError = true for your kill process activity so it will not throw exception moreover will just kill the process of the current user logged in.