'windows server 2008: How to identify who is logged on to the server

My windows server 2008 allows only one user to login at a given time. When another user tries to remote login into the same server, the previously active user's session gets disconnected. This is creating few problems for us.

Can anyone tell me a way to find whether a user has already logged into the server/ to find currently active user without actually having to login into the server so that the already active user's session will not be disturbed.

Pl provide your valuable thoughts.



Solution 1:[1]

there are 2 type of users interactive (which you are looking for?) and non-interactive (System, batch, network etc.) So there is an API Win32_LogonSession which you can see. also there is a good article on http://www.codeproject.com/Articles/7483/Enumerating-Logon-Sessions

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hjindal