
When connecting to a Remote Desktop (RDP) or Windows VPS, you may encounter the common error: “The terminal server has exceeded the maximum number of allowed connections” (or on modern Windows Server: “The number of connections to this computer is limited and all connections are in use right now”).
By default, Windows Server permits a maximum of two concurrent administrative Remote Desktop sessions. When users disconnect by simply clicking the top window “X” rather than properly logging off, their session remains active in the background, consuming one of the available connection slots until no new users can log in.
Why this error happens: Disconnecting vs. Logging Off
Understanding the difference between closing an RDP window and logging off is key to preventing lockouts:
- Disconnecting (Closing the “X” button): Leaves your user account logged on, keeps your programs and browser tabs running in memory, and holds an active RDP session slot.
- Logging Off (Start > Sign out): Completely closes background user processes and frees the RDP slot for the next connection.
If two disconnected sessions linger on the server, any third connection attempt is immediately blocked with the maximum connections error.
Method 1: Force connection using the /admin console switch
You can force Remote Desktop Connection to override standard session limits by opening an administrative console session directly from your local PC:
- On your local Windows computer, press Win + R to open the Run dialog.
- Enter the following command (replace
YOUR_SERVER_IPwith your actual server IP and port):mstsc /v:YOUR_SERVER_IP /admin - Press Enter.
- Enter your
Administratorcredentials. This forces an administrative session into the server, bypassing regular session caps.
Method 2: Disconnect stale sessions via Task Manager
Once you are logged into the server via the /admin switch or emergency VNC:
- Right-click the taskbar and open Task Manager.
- Click on the Users tab.
- Inspect the list of active and disconnected user sessions.
- Right-click on any inactive or disconnected session and select Sign Off (or Disconnect).
- This immediately releases the locked session slots, allowing standard RDP logins to resume.
Method 3: Reset stuck sessions via Command Line (qwinsta & rwinsta)
If you have SSH access, PowerShell remoting, or open a Command Prompt inside the server, you can query and reset sessions via native Windows CLI tools:
1. List active sessions:
qwinsta
This outputs all session names, usernames, session IDs (e.g. ID 1, ID 2), and their current state (Active or Disc).
2. Kill the stuck session ID:
rwinsta 2
(Replace 2 with the numeric session ID you wish to log off).
Method 4: Configure Group Policy for automatic session timeouts (Permanent Fix)
To prevent this error from recurring, configure Windows Server to automatically terminate disconnected sessions after a period of inactivity:
- Press Win + R, type
gpedit.mscand press Enter to open the Local Group Policy Editor. - Navigate to:
Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits - Double-click on Set time limit for disconnected sessions:
- Set policy to Enabled.
- Set the timeout dropdown to 15 minutes or 1 hour.
- Double-click on Set time limit for active but idle Remote Desktop Services sessions and set to desired threshold (e.g. 2 hours).
- Click Apply and OK.
Method 5: Emergency rescue via Aminserve control panel
If you cannot connect via the /admin switch, you can resolve the issue in seconds using our client panel:
- VNC Console: Log in to Aminserve Client Area, open your active service, and launch the out-of-band HTML5 VNC console as explained in our VNC rescue guide.
- Server Reboot: Click Reset or Reboot in your panel to clear all stuck memory sessions.








