Managing Remote Terminal Sessions — The Easy Way

Managing Remote Terminal Sessions — The Easy Way

Windows 2000 brought in an elegant way of working on remote desktops by the concept of Terminal Services. But it was an additional Windows component that needed to be installed and configured, which meant additional license costs and administerial functions to setup and followup. However, it did gain in a perspective that the dependency on a third party application be it commercialware (like pcAnywhere etc) or an opensource (VNC, RealVNC etc) was broken down.

Windows XP took this one step ahead with the concept of Remote Desktop by way of RDP protocol. However, it allowed only one user to work on the system, transferring the control appropriately.

I have been using Windows 2000 Terminal Services for a long long time and one daunting and nightmarish problem that I had to face is that to ensure that users logoff rather than disconnect. When you disconnect a session, Windows Terminal Services remembers this and prevents any new users from opening a connection unless the free sessions are available. The default session count, I guess, is 2 for Windows Terminal Services.

Last week, while casually surfing the web, I came across two nice tools to manage this scenario:

  1. qwinsta.exe:  Displays information about Terminal Sessions
  2. rwinsta.exe: Resets the session subsystem hardware and software to default values. Effectively, you can use this tool to reset disconnected users so that other users can login.

From a developer’s perspective, I feel, that we can have a simple Windows Form application in C# to manage these. Perhaps this weekend, I would try to get a small application and publish it over my personal website for other readers’ use.

From C#, we just need to use WTSAPI32.dll using DllImport to manage the functionalities of QWInsta and RWInsta. More information about this tool over here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/run_time_linking_to_wtsapi32_dll.asp


/* Migrated from Daffodilnet Express — posted on January 1, 2006 */

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>