delphipascalsessionid

Get correspond username from session id Delphi


enter image description here

I saw this from my task manager and found out that they both are running under the same user name but different session id. Is it possible for me to determine the corresponding username from the session id using Delphi?


Solution

  • Probably calling WTSQuerySessionInformationW will do. See Microsoft documentation.