Get Windows user name from SessionID
Is there a method in C# to retrieve the user name from a given session id? (any session running on the system) The Win API function WTSQuerySessionInformation does this, but I'm searching for this funcationality in C#. joe There seems to be no .NET integrated method for this. So this is the current solution, using Windows Terminal services API: [DllImport("Wtsapi32.dll")] private static extern bool WTSQuerySessionInformation(IntPtr hServer, int sessionId, WtsInfoClass wtsInfoClass, out System.IntPtr ppBuffer, out int pBytesReturned); [DllImport("Wtsapi32.dll")] private static extern void