I only get these "Terminal server has exceeded the maximum number of connections" when its 3 am and I am dealing with a production problem where I absolutely need access at that moment. Naturally any admin etc is sleeping and unavailable. Personally walking to the office in my jammies is something I like to avoid so I figured there had to be a better way to get around it and there is. perhaps this is not interesting but I would have bookmarked this a while ago if I had seen it before.
Step 1: Download psexec from microsoft http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx
Step 2: Unzip into a folder (let's say c:\pstools)
Step 3: psexec \\yourserver -u yourusername -p yourpassword qwinsta you will get an ouput like this:
| C:\PsTools>psexec \\MyServer -u gregy -p YeahRight qwinsta PsExec v1.93 - Execute processes remotely Copyright (C) 2001-2007 Mark Russinovich Sysinternals - www.sysinternals.com SESSIONNAME USERNAME ID STATE TYPE DEVICE >console 0 Conn wdcon rdp-tcp 65536 Listen rdpwd user1 1 Disc rdpwd rdp-tcp#21 user2 2 Active rdpwd qwinsta exited on MyServer with error code 0. |
| Output Qwinsta |
Step 4: Kill a connection. Grab the ID field in the above and use it in psexec \\yourserver -u yourusername -p yourpassword logoff ID /v
| C:\PsTools>psexec \\MyServer -u gregy -p YeahRight logoff 2 /v PsExec v1.93 - Execute processes remotely Copyright (C) 2001-2007 Mark Russinovich Sysinternals - www.sysinternals.com Logging off session ID 2 logoff exited on \\MyServer with error code 0. |
| Output of log off |