Introduction
When the Remote Desktop Session Host role is installed on Windows Server, a 120-day grace period begins during which clients can connect without CALs (Client Access Licenses). After this period expires without a properly configured RD Licensing server, all RDP connections are refused with the error The remote session was disconnected because there are no Remote Desktop client access licenses available for the remote computer.
Symptoms
- RDP connection fails with
Remote Desktop Licensingerror message - Error code:
The remote computer disconnected the session because of an error in the licensing protocol - Event Viewer shows
Event ID 66in Microsoft-Windows-TerminalServices-LicensingClient - Console access (via Hyper-V or cloud provider) still works
- Only 2 concurrent admin connections work (for server administration)
Common Causes
- RD Session Host role installed without configuring a licensing server
- 120-day grace period elapsed without purchasing and installing CALs
- License server not activated or CALs not installed on the license server
- License server firewall blocking RPC ports (135, dynamic range)
- CAL type mismatch (User CAL vs Device CAL)
Step-by-Step Fix
- 1.Access the server via console (out-of-band management):
- 2.Use Hyper-V console, cloud provider serial console, or physical KVM to gain access.
- 3.Check the licensing grace period status:
- 4.```powershell
- 5.$obj = Get-WmiObject -Namespace "Root\CIMV2\TerminalServices" -Class "Win32_TerminalServiceSetting"
- 6.$obj.GetGracePeriod()
- 7.
` - 8.Option A: Install and configure RD Licensing properly:
- 9.```powershell
- 10.# Install RD Licensing role
- 11.Install-WindowsFeature RDS-Licensing -IncludeManagementTools
# Activate the license server (requires internet or phone) # Use Server Manager > Remote Desktop Services > Overview > Deploy RD Licensing
# Install CALs through the RD Licensing Manager # rdlicmgr.msc ```
- 1.Option B: Remove the RD Session Host role if not needed:
- 2.```powershell
- 3.Remove-WindowsFeature RDS-RD-Server -Restart
- 4.# This reverts to standard 2-admin RDP connections
- 5.
` - 6.Option C: Reset the grace period (temporary workaround):
- 7.```powershell
- 8.# Delete the grace period registry key (note: this is a workaround, not a license)
- 9.$path = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod"
- 10.# Take ownership first
- 11.$acl = Get-Acl $path
- 12.$acl.SetOwner([System.Security.Principal.NTAccount] "Administrators")
- 13.Set-Acl $path $acl
- 14.Remove-Item $path -Force
- 15.Restart-Service TermService -Force
- 16.
` - 17.Configure the RD Session Host to use the license server:
- 18.```powershell
- 19.$obj = Get-WmiObject -Namespace "Root\CIMV2\TerminalServices" -Class "Win32_TerminalServiceSetting"
- 20.$obj.SetSpecifiedLicenseServerList("licensing-server.domain.com")
- 21.$obj.SetCloseToLicenseServer(1)
- 22.
`
Prevention
- Configure RD Licensing during initial RDS deployment, not as an afterthought
- Track the 120-day grace period end date in your asset management system
- Set calendar reminders at 30, 60, and 90 days to complete licensing
- Use Remote Desktop CALs appropriate for your access model (User vs Device)
- Document the licensing server FQDN and CAL inventory in your runbook