Auto disconnect for specific users on Windows Server 2022

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

EJA

New Member
May 24, 2023
2
0
1
Hello, we have one tower server that runs windows server 2022 and everyone RDPs in with their own account and they should disconnect after 5 minutes of inactivity. Except for one user that is in the control room and that should not disconnect. I tried using local policy but you can't exclude a user from it and I tried computer management -> users -> session idle log off time but it was inconsistent. I also looked into using GPO but group policy like that is for multiple computers under a domain which is not the case for this. Help on this would be appreciated. I just want all users except one to auto disconnect after 5 minutes on inactivity on their RDP.

I've been trying to figure this out for the longest time, you'd be my hero if you knew how to do this
 
Last edited:

EJA

New Member
May 24, 2023
2
0
1
use powershell and the query session command. run it on a schedule.

Here is an example of getting the data...


Chris

Hello, I appreciate the suggestion. I want to just disconnect the user, not log them off. My bad, I'll edit the question