13

We have a Windows 2008 R2 server with no active directory, single credentials for all.

It is possible to disconnect from a session without logging off.

Is there a way to connect directly to a disconnected session while I know its Session ID ?

Clarification: tscon is good, but I want to connect directly to the session.

Currently, I log on to all till I find the wanted session.

Ofiris
  • 243
  • 1
  • 3
  • 9
  • If there is more than one disconnected sessions, doesn't the server's UI prompt you for a selection? You can **click** the session you prefer. On Server 2003-R2, **the UI will show you the session ids** and timings. On Server 2012-R2, the session id is hidden but the from the timings alone you can guess which session you want. (And if there is only one disconnected session, then it's automatic of course since there's no choice available.) – Pacerier Feb 28 '15 at 00:12

1 Answers1

16

Note that mstsc.exe has no (documented) options to supply a session ID.

But once you have logged in to the Remote Desktop Session server, you can change the session you are connected to by issuing

tscon <session id> /v

See MS KB 321703 for details on tscon.

Alternatively, you might use tsadmin.msc and the "Connect" function from the context menu of the "Sessions" tab:

tsadmin.msc

As another idea, you could try supplying an alternate shell with the RDP configuration file which would run tscon <sessionID>, but I am not quite sure it would really pan out as you intend it to.

the-wabbit
  • 40,319
  • 13
  • 105
  • 169
  • 1
    This is a nice option, but the question is can I connect **directly** to the required session ? +1 – Ofiris Apr 25 '13 at 09:11
  • @Ofiris [***`mstsc.exe` has no (documented) options to supply a session ID***](http://technet.microsoft.com/en-us/library/cc753907(v=ws.10).aspx). You could *try* supplying an [***alternate shell with the RDP configuration file***](http://ls.df.vc/files/rdp/RDP_file_settings.htm) which would run `tscon `, but I am not quite sure it would really pan out as you intend it to. – the-wabbit Apr 25 '13 at 09:25
  • yup, if it gets to it I guess I will just use the `tscon` option, I thought there was an easy way. Add your comment to the answer, I will accept your answer. – Ofiris Apr 25 '13 at 09:29
  • @the-wabbit, He is asking for 3rd party apps. – Pacerier Feb 27 '15 at 23:58
  • 1
    @the-wabbit, I have `tscon` on Server 2003 R2, but What's the equivalent of `tscon` in Server 2012 R2? – Pacerier Feb 27 '15 at 23:58