Terminal server Logoff Inactive users

18th July 2023

There are a few solutions, some simpler than others

Local Policy: (simple and reliable)

on Rdweb server start gpedit.msc

Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time limits
Set time limit for disconnected sessions = Enable
choose a time like 2 hours
reboot

Logon hours: (Simple)
Set everyone’s login hours to 1am-11pm. Users get ejected every evening
Logon hours can be set per user with the command
net user – to get a list of local users
net user username – will give user details including Logon Hours Allowed
net user Guest /time:”Su-Sa,1am-11pm” – sets the Logon Hours Allowed to 1am – 11pm

Start, run, MMC
File, Add Remove Snap-In, Group Policy Object, Local Computer
Computer Configuration, Windows Settings, Security Settings, Local Policies, Security Options, Network Security: Force Logoff when logon hours expire = ENABLE.

Pros: Simple, per user, doesn’t require a domain, doesn’t require additional software
Cons: Based on Time-of-Day not Inactivity, Harder to configure as # of users increase, doesn’t work for online accounts

Logoff Screensaver: (Middling)
Download a 3rd party screensaver to logoff users after Inactivity
I used WinExit.scr from the Win2003esourceKit which isn’t published anymore
AutoIT Screen Saver also works but it requires Dot Net Framework 3.5+

More Info here if i’m not being explicit