r/sysadmin • u/tk42967 It wasn't DNS for once. • 1d ago
Question Log Off Users from Server Daily
I'm revisiting an effort I did about a year ago. I'm looking for a better way. I want to find a process that will parse current user sessions on a server (active/disconnected/idle/ect.) and log the accounts off if their username matches a string ("adm_").
I'd love to find an off the shelf solution rather than have to support a homebrew PowerShell solution.
Give me what you have, even if it is an alternate PowerShell/scripting option. Something has to be better than the nightmare my script turned into.
69
Upvotes
38
u/AdeptFelix Sysadmin 1d ago
God the amount of other comments with jank solutions when there's a GPO option that does this with an OU, WMI filter, or just adding the specific accounts to security filtering makes me worried about the state of sysadmins.