Using WMI (regardless of the actual programming language), it's possible to get the currently logged on user using a query such as Select UserName from Win32_ComputerSystem
. All nice and good.
But what if multiple user sessions and/or Terminal Services are involved? Is it possible to list all the currently logged on users on a given system? How?
If WMI is not the best option here, and/or if there are other available tools, feel free to advice. I'm mainly interested in .NET/C#.