The best way to customize a job that will terminate idle Remote Desktop sessions

Marko Todorovic 61 Reputation points
2021-03-20T10:03:47.593+00:00

Hi all,

I was looking for some solutions that would best fit for this type of request but I need help from you MS pros what would be the best way to do it.

Scenario: We have couple of terminal servers (RDS licensed) that bunch of users use for their operational / day-to-day work. As it is well known, plenty of users forget or simply don't think about signing out from those RDP sessions at the end of their work. The result here is their sessions staying idle in Task Manager, eating up a lot of memory which slows down the machines.

My first thought was to set up a policy in computer management that will terminate those sessions every 24hrs but, here comes the question how to customize the solution and go for a different approach. Because couple of users should not be disturbed by this policy and I would like to make an exception for them (as they need their sessions to stay intact).

What would be the better option here? To come up with a script that will terminate users but with exception of already stated usernames? All of those users (those whose sessions should be terminated and those which shouldn't) are members of the same OU in AD.

Thanks a lot for your assistance and keep it up!

Marko

Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,258 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grace HE 1,241 Reputation points
    2021-03-22T08:37:35.037+00:00

    Hi Marko,
    Thank you for posting your query. According to your description, you have tried editing the group policy. To achieve your goal, you have missed some details. Here are some suggestions.
    To set the group policy correctly, you can refer to this official document.
    Configure Timeout and Reconnection Settings for Remote Desktop Services Sessions
    https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc754272(v=ws.11)?redirectedfrom=MSDN
    To know information about sessions on a Remote Desktop Session Host (RD Session Host) server, you can refer to this link.
    https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc731503(v=ws.11)?redirectedfrom=MSDN

    The key point to solve your problem is setting a new GPO. For you want some particular users not to be teminated, setting GPO and then apply the group policy to this GPO is of great importance.
    To set up a new GPO, you can refer to this link.
    https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-firewall/create-a-group-policy-object

    ---If the suggestions above are helpful, please ACCEPT ANSWER. Really appreciate. This will also help others with similar issue to find this post quickly. ---

    Best Regards,
    Grace