Connecting to Terminal Services When All Active Sessions are Used

UPDATE: If you are using Windows Server 2008, the switch is /admin not /console. See this post for details.

We use Remote Desktop (Terminal Services) to remotely manage a Windows 2003 server that is not part of our domain. Recently we ran into the two user limit for remote desktop connections, which barred anyone from connecting.

Jon discovered a neat little trick that got us in. He ran the following command from the command line:

mstsc -console

It turns out that mstsc.exe is the remote desktop connection application. The -console flag specifies that we want to connect to the console session of a server. Since we generally launch Remote Desktop from the icon, we almost always leave this console session free. Nice!

When I got back in the server, I used the Terminal Services Manager tool to reset the disconnected and idle sessions. I then used Terminal Services Configuration tool to set a timeout for disconnected sessions. Finally, I remembered to logout rather than simply close the remote desktop window. Simply closing remote desktop doesn’t reset the session.

Technorati Tags: ,

What others have said

Requesting Gravatar... Jeff Atwood Oct 13, 2005 9:30 PM
# re: Connecting to Terminal Services When All Active Sessions are Used
Also this

http://www.codinghorror.com/blog/archives/000222.html
Requesting Gravatar... Marcus Lenngren Oct 14, 2005 1:39 AM
# re: Connecting to Terminal Services When All Active Sessions are Used
Hello Doc, I think this post broke the validation of your feed. Neither FireFox or MagepieRSS can parse it.

XML Parsing Error: not well-formed
Location: http://haacked.com/Rss.aspx
Line Number 72, Column 46:MSTSC [<connection file="">] [/v:<server[:port]>] [/console] [/f[ullscreen]]

-m
Requesting Gravatar... Haacked Oct 14, 2005 9:05 AM
# re: Connecting to Terminal Services When All Active Sessions are Used
Thanks Marcus. I just fixed it and checked feedvalidator.org. It validates now.
Requesting Gravatar... Marcus Lenngren Oct 15, 2005 2:08 AM
# re: Connecting to Terminal Services When All Active Sessions are Used
Great. Thanks :)
Requesting Gravatar... Michiel Jul 31, 2006 2:58 AM
# re: Connecting to Terminal Services When All Active Sessions are Used
In a pinch, I sometimes tell TS manager to connect to another server and then kill off any idle sessions.

But the console connection option of MSTSC is a neat find, I had overlooked it myself.
Requesting Gravatar... you've been HAACKED Oct 11, 2006 5:41 PM
# Tip For Managing Remote VMWare Server
Tip For Managing Remote VMWare Server
Requesting Gravatar... you've been HAACKED Oct 17, 2006 7:54 AM
# Remote Desktop On A Non-Standard Port
Remote Desktop On A Non-Standard Port
Requesting Gravatar... Rodrigo C. Souza Jul 03, 2007 4:22 PM
# re: Connecting to Terminal Services When All Active Sessions are Used
You rock man!!, Cool, very cool!
Saved my live!!
Bye.
Requesting Gravatar... Jab Apr 01, 2008 11:55 PM
# re: Connecting to Terminal Services When All Active Sessions are Used
Sweet!! thanks for the tip man, just used it!
Requesting Gravatar... milind Jul 14, 2008 7:40 AM
# re: Connecting to Terminal Services When All Active Sessions are Used
Simply Great...
Requesting Gravatar... Vin Jan 05, 2010 12:29 PM
# re: Connecting to Terminal Services When All Active Sessions are Used
Great Post! It helped me. I used mstsc /v servername /admin to logon as an admin

What do you have to say?

(will show your gravatar)
Please add 8 and 4 and type the answer here: