Reputation: 750
Is there a way to switch an existing user's process (that's running as user x) to another user (user y) in .Net/C#? Now I'm not referring to impersonating a user and executing a new process on their behalf. I'm referring to the possibility of handing over a running process to another user, programmatically, without having to re-execute the process/application as the new user.
Upvotes: 2
Views: 270
Reputation: 612993
No this cannot be done. The user token is assigned as part of the process creation mechanism and is then fixed for the duration of that process. This is one of the reasons why UAC elevation has to involve separate processes.
Upvotes: 5