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#.
This answer already exists on net. Did you try Google? I did and found (all WMI related) –
StackOverflow question (this makes your question a duplicate)
MSDN blog entry – worth trying
Web search result
I strongly recommend using a search engine first – stackoverflow/web – and if you still can’t find answers, go ahead and post your question!