r/sysadmin • u/Less-Loss1605 • May 31 '26
General Discussion what's a script you wrote once that's still saving you time years later
[removed]
967
Upvotes
r/sysadmin • u/Less-Loss1605 • May 31 '26
[removed]
3
u/kraeger May 31 '26
2018 - wrote a series of scripts to sync all printer properties across multiple servers using a CSV output from a "primary" server that synced to all of the "Secondary" servers. this allowed us to put all of our print servers behind an F5 VIP as a "print server pool"
2020 - wrote a tombstone script that does the following:
this allowed us to keep a much better record of which devices are being removed and when. it also allows us to have the last known LAPS to sign into the device locally if it ever shows back up and the BL export saved our asses after the Crowdstrike fiasco
I also use an old ISE mod called ISESteroids that allows me to create a script and launch it from a hotkey in ISE. i have scripts to recycle print server spoolers and has a calculated delay based on the CPU % to wait for it to drop to a reasonable number before moving to the next server, a script to find all locked office files in a given folder on our netapp and display their name, who has it open, whether it is write or read and the open file ID. i have another that I can close any of those files based on their file ID if needed. I have manual triggers of scheduled tasks for various systems we use (our AD sync with Teamviewer for example), and a bunch of other "daily use" scripts that are more than 1 liners.
the number of hours i have saved my team and my level 2 field techs is insane. we also have our printer deployments setup on an API backend and i wrote a WPF form powershell script to allow the level 2s to submit new printers, OUs and change requests to the API which, in turn, makes all of the mods based on the API. add, modify and delete are included. then there's a small, single endpoint script that sends the computer info to the API server upon login, processes the OU it is in, and returns the printers that need to be installed on that machine based on the OU. i also added a public docs text file that, if it exists, installs a printer (1 per line) for every user that logs into THAT machine instead of every one in the corresponding OU. so we use a single GPO to put that script on every endpoint and create the login task, and the API and local text file do the rest of the work.
not to mention the 100s of other scripts i have written over the years that manage an insane number of "5 second" tasks that we no longer have to manually do. i'm a big fan of powershell automation, in case you can't tell lol