I was recently asked this question on the forums – How do I find out and list the users connected to a server? I said use Cassia
A standard way of achieving this requirement is to use P/Invoke to access the Windows Terminal Services API. Cassia is a .NET library that acts as a wrapper on the native Windows Terminal Services API.
Cassia has been tested on Windows Server 2008 R2 Beta, Windows Server 2008, Windows Server 2003, Windows XP, and Windows Server 2000. It should work on Windows Vista as well. I haven’t tried it on Windows 7. If any of you does, kindly drop in a comment and let the users know of your experience.
Check out Cassia!