6

We provide several Remote Desktop Services (RDS) and one of the connected user can't start any RDS anymore. How can I force logoff of that user?

What I already tried:

I tried logging in as domain admin on the Terminal Server the user is connected to and force the logoff of that user via GUI[1], which was unsuccessfull. My 2nd attempt was logging him off using the Console and the tsdiscon command which didn't work neither. I also tried doing logging him off using the LOGOFF [2] command and the PowerShell Commandlet Invoke-RDUserLogoff. None worked.

[1] With using the GUI I mean both a) using Server Manager > Remote Desktop Services > Collections > [MyCollection] > Connections Area > Right-click on affected user > Log off and b) Task Manager > Tab Users > Right-click on affected user > Sign off

[2] Force authenticated user immediate logoff (emergency case)

Ronin
  • 161
  • 2
  • 2
  • 5
  • In the case that the user logoff doesn't complete successfully, are there running processes that just refuse to quit when the logoff is triggered? – austinian Nov 19 '14 at 18:41

3 Answers3

4

I'm not sure what you mean by "force the logoff of that user via GUI" so you might be referring to this, but I'll throw it out there anyway:

My GUI method is to open Task Manager on the server, go to the Users tab, then right click the user's session and choose Log Off.

If that fails to actually log off the session or their session isn't listed there, then you can try opening Computer Management on the server, go to Shared Folders, then Sessions. Sort by username, and then right click on each record for this user and clickClose Session`.

That should handle it. If it doesn't, then something is hung up/buggy that would require a reboot of the RDS server itself.

TheCleaner
  • 32,352
  • 26
  • 126
  • 188
  • GUI -> see my supplementation on the original post. In the meantime, we ended up booting the server. I now tried what you suggested but no Sessions are listed in the session folder. But I know that there are active sessions since I can see them in the task manager and server manager – Ronin Nov 19 '14 at 16:59
  • The session "folder" was a last resort. It doesn't list RDS sessions, it lists SMB sessions...but figured the user might be connected via SMB and causing a weird hangup. – TheCleaner Nov 19 '14 at 17:01
0

In PowerShell or CMD You can type: "qwinsta" to view connected sessions and #'s. Then you can type "rwinsta Session#" to kill a session.

Scott
  • 1
-1

We've been experiencing the same problem i.e. stalled user sessions prevent new login sessions after they disconnected from previous RDS session (presumably by closing RDC app only and not using Sign Off as they should). I've just applied this change via gpedit.msc on a local machine (not AD) then run gpupdate:

  1. Open "Run" and type "gpedit.msc"

  2. Go to "User Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits"

  3. Double Click on "Set time limit for disconnected sessions" and select enable then set time to "1 minute"

I will report back as soon as it's confirmed working.

  • 2
    omg no, just no. This will leave the machine in a condition after reboot where you are limited to one minute sessions until AD reaches it for its next delayed gpo push – Casper Leon Nielsen Jun 21 '19 at 09:30
  • As above, this machine is NOT Active Directory enabled. Did you actually read the description of this setting or am I missing some behaviour that's not described here? It's clearly stating that it will force log off by deleting any disconnected sessions after X minutes pass. Could you explain as your comment is not clear as to why this could cause any issues on a standalone Windows 2012 R2 server? Thanks – webcoder.co.uk Jun 22 '19 at 10:38
  • "...You can use this policy setting to specify the maximum amount of time that a disconnected session remains active on the server. By default, Remote Desktop Services allows users to disconnect from a Remote Desktop Services session without logging off and ending the session. When a session is in a disconnected state, running programs are kept active even though the user is no longer actively connected. By default, these disconnected sessions are maintained for an unlimited time on the server..." – webcoder.co.uk Jun 22 '19 at 10:39
  • " tried logging in as domain admin on the Terminal Server the user is connected to" - you ask me if I read it - did you? – Casper Leon Nielsen Jun 24 '19 at 07:02