In educational environments using thin clients with Windows Server 2008 R2 Remote Desktop Services, we frequently encounter premature session termination during the login phase. The default behavior causes RDP sessions to disconnect after approximately 60 seconds if no credentials are entered, triggering thin client shutdown per configuration.
The solution lies in modifying these registry values:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server] "KeepAliveEnable"=dword:00000001 "KeepAliveInterval"=dword:0000003c "KeepAliveTimeout"=dword:000493e0 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] "LogonTimeout"=dword:00015180 "MaxConnectionTime"=dword:00015180 "MaxDisconnectionTime"=dword:00015180 "MaxIdleTime"=dword:00015180
For administrators managing multiple servers, this PowerShell script implements all necessary changes:
# Configure RDP Timeout Settings $regPath1 = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" $regPath2 = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" # Enable keepalive with 60 second interval (0x3c) Set-ItemProperty -Path $regPath1 -Name "KeepAliveEnable" -Value 1 -Type DWord Set-ItemProperty -Path $regPath1 -Name "KeepAliveInterval" -Value 0x3c -Type DWord Set-ItemProperty -Path $regPath1 -Name "KeepAliveTimeout" -Value 0x493e0 -Type DWord # Configure timeout values (24 hours in milliseconds) $timeoutValue = 0x15180 Set-ItemProperty -Path $regPath2 -Name "LogonTimeout" -Value $timeoutValue -Type DWord Set-ItemProperty -Path $regPath2 -Name "MaxConnectionTime" -Value $timeoutValue -Type DWord Set-ItemProperty -Path $regPath2 -Name "MaxDisconnectionTime" -Value $timeoutValue -Type DWord Set-ItemProperty -Path $regPath2 -Name "MaxIdleTime" -Value $timeoutValue -Type DWord # Restart Terminal Services to apply changes Restart-Service TermService -Force
For domain environments, configure these GPO settings under:
Computer Configuration > Policies > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits
- Set time limit for disconnected sessions: Never
- Set time limit for active but idle sessions: Never
- Set time limit for active sessions: Never
- End session when time limits are reached: Disabled
After implementation, verify the changes with:
Get-ItemProperty -Path $regPath1 | Select-Object KeepAlive* Get-ItemProperty -Path $regPath2 | Select-Object *Timeout*
For thorough testing, use the Windows Performance Monitor to track Terminal Services metrics and confirm the new timeout behavior matches expectations.
In educational environments using thin clients with Windows Server 2008 R2 Remote Desktop Services (RDS), a common issue arises when the RDP connection automatically disconnects after approximately 60 seconds if no login occurs. This behavior causes thin clients to power off (as per their default configuration), creating workflow disruptions for teachers who prefer to power on devices in advance.
The timeout isn't governed by standard RDS session timeout settings (like idle/disconnect durations), but rather by the underlying RDP protocol's connection negotiation phase. Windows Server 2008 R2 implements this as a security measure to prevent connection pool exhaustion.
The most effective approach modifies the server's registry to adjust the pre-authentication timeout:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] "LogonTimeout"=dword:00000384 ; 900 seconds (15 minutes) in hexadecimal
Implementation steps:
- Open Registry Editor (regedit.exe)
- Navigate to the specified key path
- Create or modify the DWORD value
- Restart the Terminal Services service or reboot the server
For domain environments, deploy this setting via GPO:
Computer Configuration > Policies > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Security Set "Set time limit for active but idle Terminal Services sessions" to Enabled Specify "Idle session limit" = 900 seconds
For administrators managing multiple servers:
# Set timeout to 15 minutes (900 seconds) Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "LogonTimeout" -Value 900 -Type DWord # Restart service Restart-Service -Name TermService -Force
- Security implications: Longer timeouts may increase vulnerability to brute force attacks
- Test changes in a non-production environment first
- Document modifications for future reference
- Consider implementing complementary security measures like Network Level Authentication
Confirm the setting took effect by checking the registry value or running:
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" | Select-Object LogonTimeout