There must be something in the air. Lately, I’ve been receiving a lot of email about logoff problems. As one reader wrote, "We use a terminal server in a educational environment, and a lot of our users don't log off correctly. We discovered that the Terminal Session Manager's RDP-TCP numbers increased, and when the total number approached 400, the client generated a 'registry too large' error message. Rebooting the server refreshes the session number counts and seems to address the issue."

We can probably all see what’s happening here. The terminal server maintains a separate copy of the registry key HKEY_CURRENT_USER for each person logged on so that all users can personalize settings. If users don’t log off, their copies of HKEY_CURRENT_USER remain in the registry, resulting in that "registry too large" error. The users' sessions also remain active on the terminal server. By design, a disconnected session remains in stasis so that its originator can come back to it--a feature that takes up terminal server resources. Rebooting the server shuts down all the disconnected or idle terminal sessions.

The obvious solution is better user training so that users know to log off instead of disconnect from sessions. However, it's not always that easy. When users leave their terminal sessions, many of them do what they've done for years when they finish using an application: They click the X in the top-right corner and close the window. When a user closes a session window that displays a desktop, they see a dialog box warning them that they’re only disconnecting from the session, not terminating it. But how many informational dialog boxes do people click through every day without reading them?

It’s not just users who have this problem, either. Administrators new to terminal services are susceptible as well. One person who had read "Mastering Windows 2000 Server" wrote to ask me, a coauthor, how to log off of sessions—he was experiencing the disconnect/logoff problem himself. I had spelled out the difference between terminating and disconnecting a session in the book, but apparently not plainly enough.

By all means, explain to your terminal server users why it’s important that they log off and that doing so won’t log them off of the domain altogether (if they use a PC). Show them how to log off a terminal session correctly. But you can also take advantage of the tools at your disposal to keep disconnected sessions from proliferating. If you use Windows 2000 Server Terminal Services, open the per-users Properties sheet and click the Sessions tab. The Sessions tab options disconnect sessions and let sessions remain logged on or disconnected indefinitely. By default, the per-user session timeout settings control these things, but if you open Terminal Services Configuration, you can set the properties for the display protocols so that the session timeouts (again, on the Sessions tab) override any per-user settings. For one-off problems or to see how many disconnected sessions are active on the terminal server, open the Terminal Services Manager and select a server. The Users tab shows all the current sessions running on that server and their current status (Active, Idle, or Disconnected).

With such steps, you can avoid having to reboot the terminal servers every 2 days because of Registry Bloat. Of course, other problems might cause you to reboot regularly, but we can at least minimize the avoidable memory problems on the terminal servers.