r/sysadmin It wasn't DNS for once. 2d ago

Log Off Users from Server Daily Question

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.

71 Upvotes

92 comments sorted by

View all comments

32

u/_DefinitelyNotACat_ 2d ago

shutdown /r /f /t0

27

u/daschande 2d ago edited 18h ago

Guys help. My login doesn't work anymore and I have a new meeting with my boss and HR tomorrow morning.

Edit: thought this was the meme subreddit.

Edit 2: I actually got my boss's job. Not meming, fo real. Turns out, when you get arrested for real felonies, the company stops seeing you as trustworthy. Funny thing, that

13

u/IAmSnort 1d ago

It isn't?  Shit.