what's a script you wrote once that's still saving you time years later

Posted by Less-Loss1605@reddit | sysadmin | View on Reddit | 164 comments

i wrote a powershell script like 3 years ago that checks AD for disabled accounts that still have active mailboxes and spits out a csv every monday morning. took me maybe an hour to write. it's caught orphaned mailboxes so many times since then that i stopped counting. the licensing cost it's saved us is probably more than my raise last year.

the other one is a bash script on our linux boxes that monitors disk usage and sends a slack alert when anything hits 85%. nothing fancy, just df piped through awk with a curl to the slack webhook. wrote it after we had a production outage because /var/log filled up and nobody noticed. that was a fun 2am call.

what's your version of this? the one script that keeps quietly doing its job in the background.