I am using SystemEvents.SessionSwitch event to determined if the user running my process got locked, but the event does not let you know which user got locked/unlocked.
How can I get this information (from a process owned by a low privileged user )
I am using SystemEvents.SessionSwitch event to determined if the user running my process got
Share
I don’t think you can for partially trusted code. If your application or part of it could be made into a full-trust service, the session ID could be retrieved as specified in the answer to a related question.
Then given the session ID, you could find any process with that session ID to get the actual user (abstracted from Getting Windows Process Owner Name):