2

Lets say we have a Windows 2008 server and there are 4 users (A,B,C,D) logon. If User "B" disconnects from the session ('broken connection'), how can we automatically log off User B? I've searched and we can use 'Remote Desktop Session Host Configuration' to setup disconnected users to log off, but it applies to every/all users. How can we make that rule applicable to a specific user?

2 Answers 2

4

Create a scheduled task that runs a powershell script

Get-TSSession -State Disconnected -UserName userName |  Stop-TSSession -Force

Or just group all such users into a dedicated server...

1

Go to Computer Management, click Local Users and Groups, find your username, and click Sessions tab. From there, you set the different options.

1
  • Side note: This will not work with a domain environment. Users will not show up in the Local Users on the server if logged in as a domain users. You would have to do this through the Active Directory Users & Computers snap-in. I would prefer this method over the scheduled tasks/powershell because you would be forced to manually code every username into the script. Even on a small domain this could get arduous.
    – Travis
    Oct 20, 2015 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .