When connecting to a remote computer via RDP, you may receive a blue screen error indicating that you have exceeded the maximum number of connections allowed. In my case, the problem occurred with users on Windows Server 2022 with the Remote Desktop Services (RDS) role.
The number of connections to this computer is limited and all connections are in use right now. Try connecting later or contact your system administrator.
If you are experiencing this error, the first step is to determine which version of Windows is running on the remote computer. Different versions of Windows have different limits for the maximum number of concurrent RDP sessions.
- Maximum one simultaneous RDP connection to desktop versions of Windows 10 and 11 (Pro or Enterprise edition)
- Two administrative RDP sessions (+ one console connection) to a computer running Windows Server 2022/2019/2016, etc.
- If the Remote Desktop Services role is installed on a Windows Server host and it is configured to get terminal licenses from an RDS licensing server, the maximum number of connections is limited by the number of available licenses (RDS CALs)
If the problem occurs on a Windows Server RDS host with a sufficient number of free RDS CALs, or on Windows 10/11 with an unofficial termsrv patch or RDP wrapper (which removes the limit on the number of simultaneous RDP connections), make sure that there is no limit set on the maximum number of RDP connections.
Check the registry value using the PowerShell console:
$key = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"
(Get-ItemProperty -Path $key -Name MaxInstanceCount -ErrorAction Ignore).MaxInstanceCount
By default, this registry option should not exist. The command returned a value of 1 in this example. This value defines the maximum number of RDP connections on this host.
To increase the max connections value, open the Local GPO Editor snap-in (gpedit.msc
) and go to Computer Configuration -> Administrative Templates -> Windows Components ->Remote Desktop Services ->Remote Desktop Session Host -> Connections. Enable the Limit number of connections policy and change its value to 999999. Reboot the RDP host to apply the new termsrv service settings.
In the same way, check the ‘MaxInstanceCount’ parameter in another registry key. If necessary, increase the value manually:
$key = "HKLM:\SYSTEM\CurrentControlSet\control\Terminal Server\Winstations\RDP-Tcp"
(Get-ItemProperty -Path $key -Name MaxInstanceCount -ErrorAction Ignore).MaxInstanceCount
Also, check that the Restrict Remote Desktop Services users to a single Remote Desktop Services session policy is disabled (or not set).
$key = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"
(Get-ItemProperty -Path $key -Name fSingleSessionPerUser -ErrorAction Ignore).fSingleSessionPerUser
If the RDP connection exhaustion error occurs randomly on clients, try modifying the following registry settings on the affected computers:
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v MaxConnectionsPer1_0Server /t REG_DWORD /d 10
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v MaxConnectionsPerServer /t REG_DWORD /d 10
If nothing helps:
- Kill some active or idle user sessions on a host (or reduce RDP session timeouts for disconnected and inactive sessions).
- Restart the Remote Desktop Services service:
Restart-Service TermService -Force
- Reboot the RDS host.