When a Terminal Server client abnormally (power failure, network failure, etc..) loses their connection to the Terminal Server, their session may not be marked as disconnected. When the client logs on again, a new session is created, leaving the origonal session active, consuming resources.
To fix this problem, apply the latest Terminal Server Service Pack. Then use Regedt32 to navigate to:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server
On the Edit menu, Add Value name KeepAliveEnable as a type REG_DWORD. Set the data value to 1. The default is 0.
Use the Connection Configuration tool to double-click rdp-tcp, and click Advanced.
Locate the On a broken or timed-out connection, connect action the session line. Then:
Clear the Inherit User Config check box.
Check Disconnect.
Press OK.
With these settings, KeepAliveEnable will use Carrier Loss Detection,
polling each client every (KeepAvileInterval / #sessions), to disconnect the client session.