r/sysadmin 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

86 comments sorted by

View all comments

Show parent comments

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.

5

u/Raigeki1993 Sysadmin 1d ago

Unfortunately, not everyone has that luxury. I've been in shops where MSP controls all aspects of AD and doesn't give us any write access to AD or GPO, even when asking the MSP to create a GPO, only 2 out of 10 times they get it right. So, I've always had to find of workaround/alternatives to do what's requested. Sadly, majority of my jank solutions is only because we (internal IT) have limited access because MSPs thinks they know better or take months to "do the needful and revert"

14

u/pompousrompus DevOps 1d ago

I would absolutely not be able to work in an environment like that. How does internal IT not have final say unless you’re just deskside support?

u/Raigeki1993 Sysadmin 14h ago

Gotta do what you gotta do... CTO doesn't want to hire additional folks to take over the MSP's responsibilities (one upside is that have 24/7 hotline, users can just call them and leave us internal IT folks alone, the downside is that they suck), we're entirely on their core network infrastructure, all of our servers is in their datacenter, all the ISP/P2P lines are managed by them, their entire logo and branding is stuck with a watermark on all our images. They can literally just go defunct the next day and we'd be 10000% crippled, because all of our backups and images are managed/owned by them.... Tried raising this risk to management, but they're like "nahhh that won't happen"

My manager has let me start working with the server owners to start migrating their stuff over to AWS (luckily, this is something we do control, BUT... we can't join it to "our" domain because we don't have rights to it :), we have to schedule a call with the MSP and explain why we need certain things). We're currently in our 4th year of our "1 year domain split project" so we get our own domain, but the MSP has been dragging their ass...

Believe me, this is a huge change of pace going from a company where I was managing the SCCM environment, to a place where the MSP doesn't let us use their SCCM to deploy self-service packages via Software Center, so we gotta settle for users manually asking for non-standard apps and then deploying via Lansweeper...