How to prevent a person B to kick of person A remote desktop connection, on Windows?

9,491

Solution 1

I know this is an old question but just today I was confronted with the same problem. I stumbled on this thread while looking for an answer. Not having found a solution anywhere I had to roll up my sleeves, build a test environment and do some testing. Here is the solution:

  • Open gpedit and go to Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections.

  • Find the setting Limit number of connections. Set it to "Enabled" and set the value for RD Maximum Connection allowed to 1. Reboot or run gpupdate.

After this is applied, when a second user tries to login to a machine with another user logged in, this is what they will see:

IMG:

Solution 2

Remote Desktop/Terminal Services has two settings for multiple sessions: You can either allow multiple sessions per user (in which case if you log in twice, you'll get two sessions), or force a single session per user (in which case you can only log in once and subsequent sessions will be redirected to the original session).

To change this setting:

  • Start 'regedit.exe'

  • Navigate to the following registry key:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer

  • If the value fSingleSessionPerUser doesn't exist, create it as DWORD

  • The fSingleSessionPerUser values are as follows:

    • 0x0 : Allow multiple sessions per user
    • 0x1 : Force each user to a single session
  • Enter the new value and click OK.

Share:
9,491

Related videos on Youtube

zlatko
Author by

zlatko

Updated on September 18, 2022

Comments

  • zlatko
    zlatko over 1 year

    Person A and Person B use the same non-admin Windows user account to start remote desktop connection. Person A starts remote desktop connection and works on a document. When person B then starts another remote desktop session, it kicks-off (terminates) previous remote desktop connection established by person A, even without any warning. How can I prevent that? (I wish to set that another person cannot terminate previously established remote desktop connection without explicit permission by person who started connection first...)

    • spikey_richie
      spikey_richie over 4 years
      Depending on the host you're connecting to, you should be able to run 2 remote sessions. 1 in the admin console, and another as a domain user. Why not just give the users domain accounts remote access?
    • zlatko
      zlatko over 4 years
      Not going into details, but those two users must use the same Windows non-admin user account. Running two or more concurrent sessions for the same Windows user account is also not an option. The question is how to prevent person B to terminate already established remote connection by person A.
    • Ronaldo
      Ronaldo over 4 years
      What is the OS version?
    • harrymc
      harrymc over 4 years
      Is this on Windows Server?
    • zlatko
      zlatko over 4 years
      Yes, Windows Server 2016
  • zlatko
    zlatko over 4 years
    Hi, I wish to allow only single session per user. But, the problem is that if person A first starts remote session for the Windows user X, and then person B starts new session for the Windows user X, new session terminates the previous one. I need it opposite way - that user B cannot start new session while user A is connected. I hope this clarifies the essence of my question.
  • harrymc
    harrymc over 4 years
    Try in gpedit to go to "Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections\" and enable "Restrict Remote Desktop Services users to a single Remote Desktop Services session" and reboot. The documentation isn't very clear on what is the difference between Not configured and Enabled. If this does not make a difference, then I don't know of any other solution.
  • djk
    djk about 3 years
    Tried in Windows Server 2019, didn't work when someone else connects with the same username. It still kicks the first session out.