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)

  • 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, 2014 at 18:41

3 Answers 3


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.

  • 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, 2014 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, 2014 at 17:01

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


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 Jun 21, 2019 at 9: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 Jun 22, 2019 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..." Jun 22, 2019 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? Jun 24, 2019 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.