Wednesday, 22 May 2013

The terminal server has exceeded the maximum number of allowed connections

What:

Windows Server 2003/2008

Problem:

Can't log on to the server via RDP, disconnected sessions used up allowed number of connections.

Solution:

Quick solution:

Start > Run

Type in the following command and hit enter
mstsc /v:<server_name> /admin

Longer solution:

You can also log off users via cmd
Log on to any other server on the network

Start command line console and type in
query session /server:<server_name>
You should see logged on users, now using ID you can end selected session
reset session <ID> /server:<server_name>
Example:
reset session 3 /server:192.168.1.10

3 comments:

  1. It is /v
    If you have any doubts just run mstsc /?, you will get list of all available switches.

    ReplyDelete
  2. Simply create a bat file with anyname.bat and run with Admin rights. :) Copy the script below ......


    @echo off
    setlocal
    call :Quiet>nul 2>&1
    set key=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing
    for /f "Tokens=*" %%a in ('REG QUERY %key%^|find /i "%key%\"') do (
    @echo REG DELETE "%%a" /F
    REG DELETE "%%a" /F
    )
    endlocal
    goto :EOF
    :Quiet
    NET START TERMSERVICE



    Thanks :) Enjoy

    ReplyDelete