How to specify to MSTSC which session to connect to?

7,974

Solution 1

Use Local Security Policy (or Group Policy if the machine is in a domain) to limit users to a single RDP session.

Open Local/Group Policy.

  1. In Computer Configuration, Administrative Templates, Windows Components, Terminal Services, double-click the Restrict Terminal Services users to a single remote session setting.

  2. Click Enabled, and then click OK.

Note: Replace "Terminal Services" with "Remote Desktop Services" if on a modern version of Windows.

Solution 2

I found another great answer to this question here: http://sqlservertimes2.com/?p=55.

If you connect to a remote desktop and it creates a new session instead of connecting to your existing session, do the following:

Run taskmgr and go to the Users tab and note the ID number of your previous session.

Run tscon n where n is the ID number. Your remote desktop session will be immediately switched to the specified session.

Share:
7,974

Related videos on Youtube

Vivian River
Author by

Vivian River

Updated on September 18, 2022

Comments

  • Vivian River
    Vivian River over 1 year

    I'm working on a project where I must do almost all of my work on a remote desktop. I also have to frequently connect and disconnect from the remote desktop because of the network configuration.

    Sometimes, when I disconnect my session and then connect again, I get connected to the same session. Other times, it starts a new session for me, but I can tell that the old session is still running because it shows a warning if I click to restart the computer.

    There seems to be no rhyme or reason to this. Given the choice, I would like to make MSTSC always connect me to my existing session.

    How do I do this?

  • Vivian River
    Vivian River about 10 years
    I'm marking this as the answer. However, the second answer may be more appropriate depending on exactly what your needs are.
  • Ryan Ries
    Ryan Ries about 10 years
    Yep, that's true. Both answers given will solve your problem. Feel free to mark whichever one better fits your needs as the answer. I promise you won't hurt my feelings. ;)
  • Vivian River
    Vivian River about 10 years
    This answer has the advantage that it only has to be done once. The other answer has the advantage that it can be done without changing system settings requiring admin permissions, and it allows for multiple sessions where that might be necessary.
  • Saqib Vaid
    Saqib Vaid over 4 years
    Can you mention how to access the Terminal / Remote Desktop Services settings in Windows Server 2016?. I tried but couldn't find. Thanks.
  • Sam Jackson
    Sam Jackson over 4 years
    The accepted answer may be the best way to prevent this situation ever happening, but odds are that a user running into the problem does not have immediate control of Group Policies—and my network admins may have very good reasons for permitting multiple connections per user. So, this solution will be applicable to far more people. Also, it's very handy for people like me using RDP from Linux systems who don't want to know any more about Windows than we can help :-)