r/computertechs • • Apr 10 '21

Desktop Techs, do you use any scripts? If so which ones? NSFW

Hello, i'm a IT college student. I've been given an assignment by my instructor to ask desktop technicians either online or in person about scripting. Whether they use them or which ones they use and why. I live in a rural area so in person is out of the question.

So what do you guys use? If you do use any scripts that is.

42 Upvotes

34 comments sorted by

30

u/throwaway_0122 Tech Apr 10 '21

My greatest achievement was using a Python script to find a client’s pictures that had a watermark on them out of millions of image files they were sent after sending their NAS out for professional data recovery. It involved them sending me their watermark, programmatically applying it to thousands of stock photos in different sizes and orientations, and using that as training data for OpenCV’s built-in ML engine.

Nowadays all of my scripting is spent fixing inventory and accounting spreadsheets. Export data from the system, fix it, and re-import it. It has mostly dragged me away from my actual job, which is computer repair.

15

u/Weedwacker01 Apr 10 '21

Fix print queue

1

u/OgdruJahad May 09 '21

I literally just added this on the PC with issues and now run it remotely with Psexec. It's awesome!

12

u/[deleted] Apr 10 '21

[removed] — view removed comment

1

u/[deleted] Apr 10 '21

[removed] — view removed comment

6

u/[deleted] Apr 11 '21

[removed] — view removed comment

1

u/DITPL May 23 '21

Ha! I don't have access to the GPO, so I just made a .bat file full of NET USE commands to remove and restore all networked drives that we use. By using %username% I can even map their personal folder on the SAN.

I either push the file to their desktop and ask them to double click on it, or I remote in and do it myself. Very handy

11

u/breid7718 Apr 10 '21

I have a ton I have written. Anytime I find myself doing the same action more than once, I write a script to take care of it. Everything from server automation to onboarding processes to things as simple as creating an Outlook event for everyday tasks.

The "why" is time and effort savings.

8

u/clbw Apr 10 '21 edited Apr 11 '21

If you work in IT and manage around 5000 servers in the enterprise then Power Shell is a must! I use it often to add groups to a large list of servers, install or remove patches or list patches. I use Power Shell scrips with Config Manager and Scom. Cert creation print server management

3

u/htmlcoderexe Apr 11 '21

One of places I worked at there was no easy way to create a new AD user with same default groups as others on same team do I remember making s script to clone AD groups.

3

u/DrC0re Apr 11 '21

If you manage around 5000 Windows servers you mean.

2

u/clbw Apr 13 '21

Well technically power Shell will work on Linux/Unix/ and can be installed on a Mac as well so it is not just limited to Windows now. But for me specifically yes Windows servers. and the team I’m on is Windows

7

u/[deleted] Apr 10 '21

Constantly! Scripts save you so much time and make the job easier! Learn how to use them and your future users will love your work.

4

u/Malechus Apr 10 '21

I script everything. If I do it more than ten times, you can assume I've made a script for it. Life is too short for repitition.

7

u/Hwzb Apr 10 '21

I work at an MSP as a Lab Tech that does setups for our clients.

One client in particular had the same cookie cutter setup so I've slowly created bat scripts to speed up the work.

It's not pretty but since I am not given much time to speed things up its what I can do. I think the 30 minutes I've spent building basic scripts to add files to the public desktop, icon images for programs etc has saved me 5+ hours already. Those scripts were only made about 10 machines ago so I'm happy with the results!

3

u/Elipes_ Apr 10 '21

I use batch scripts to automate little common tasks or installs of software/patfhes/common fixes

3

u/[deleted] Apr 11 '21

I only work on desktops. No servers. The closest thing to scripting I use is windows tweaking repair.

1

u/OgdruJahad May 09 '21

What about clearing printer queues?

1

u/[deleted] May 09 '21

Windows tweaking repair has an option for that. It runs best in safe mode.

1

u/OgdruJahad May 09 '21

It runs best in safe mode.

Or just clear printer queue in normal mode? Without having to go to safe mode?

3

u/andrewthetechie Tech by Trade Apr 11 '21

Yup.

Ones that do the stuff I need.

3

u/[deleted] Apr 28 '21 edited Apr 28 '21

My most heavily used all made by hand for one reason or another. I work in an environment of 17k units shrinking to 8k after we move to a different interface for the core userbase.

  • BAT set computer to high performance power mode
  • BAT disable USB suspend
  • BAT/PS set multiple WiFi networks with passwords and encryption
  • BAT map drives per ad access path
  • EXE/PS/BAT delete all profiles created by windows
  • BAT query and control windows firewall (all or part on off and status)
  • BAT sysinfo remote pull of group from AD (uptime, ram, storage)
  • VB full software inventory
  • PS/REG allow install (then install selection) of custom winapps
  • VB pull uuid
  • VB pull prodkeys
  • BAT gpupdate with restart
  • BAT various monitor sleep control options
  • BAT wipe print jobs and que
  • BAT/EXE/PS install psexec for remote execution of various other things
  • BAT fix the "tray bug" where icons dont show next to the clock

Additionally I created a complete hashing script in Powershell for verfying backups from specific mission critical folders/files with an alert on failure of hash verification. Code snippit below, only works in windows 8 and above. Another fun powershell script that pulls the executable bit depth be it 64 or 32bit and reports.. i married that with VB software inventory.

if((Get-FileHash $fileA).hash  -ne (Get-FileHash $fileC).hash)

2

u/htmlcoderexe Apr 11 '21

I have one that installs some standard software from the network drive, creates some shortcuts and changes a few settings.

Hardest part? Language settings. Our PCs are to be in English but with a non-English keyboard layout, and it has to be only that layout (to prevent support calls about being locked out because of typing the password on the wrong layout too many times).

To accomplish this, the batch file calls two powershell scripts and a reg file and that was the simplest way of achieving it.

1

u/JohnnyMiskatonic Apr 10 '21

Yes, I use various scripts to check if a user's account is unlocked or if their password is expired. I have scripts to update active directory information, remote software installation and system log reading, among others.

1

u/CWdesigns Apr 11 '21

Scripts are life as a desktop tech :P Between querying AD (Guess what, AD doesnt always replicate specific info when/how we want), automating software installs (Especially for custom software deployed vis SCCM), and just in general automating a lot of fixes and stuff.

1

u/Shpongolese Apr 13 '21

I want to learn how to script but i get so confused with programming. Maybe i'm just too stupid to learn...idk.

1

u/OgdruJahad May 09 '21

Start with something simple that you usually need to get done then move on to something more complex.

1

u/lordoffail Apr 15 '21

I used to run a stack of VDI's, with a bare metal chassis per location, x12 locations and about 15-20 VMs per host. nothing insane, but I tell ya, using scripts to get things done rather than making changes to each host individually is nice. Of course there is always group policy which is super handy, but there are things scripts can do better, faster and more reliably. Man, where would the industry today be without image deployment and sysprep lol.

1

u/DblDeuce22 May 12 '21

PowerShell - I use it every day for both automation, working projects, getting data, diagnostics, remediation, helping others, etc.

It's also great for administration tasks. Not interrupting the customer by using PSSessions if I need to get info or do something that isn't interactive. Be warned, once you learn to use PowerShell or a scripting language / program, your leadership will likely task you for anything they think you can do and some you can't. I learned it because a product we were reviewing had an API that could be used with PowerShell and I wanted to learn it for years anyways which presented the perfect opportunity and now I have a few production scripts and use it daily for various tasks / projects. It's on every Windows machine by default so that makes it even better.

I have a personal share with tons of various scripts I can copy from and use for other things when needed.

1

u/RealTrueGrit Apr 11 '26

So im in a different boat, also surprised i can make a reply to this thread. I work as a computer repair tech and i have already written numerous scripts to make my job easier. Currently i am working on a finalized version of my post windows 11 install script. It essentially fully sets up the new computer with our suite of software, installs windows updates, reboots, runs update sweep again, then cleans up the files and finishes out. I wanted a fully automated way of setting up a new computer.

It mixes powershell and batch, which i can combine into a .exe file.

Ive got a script for booting into safemode, i built an entire windows recovery drive through winpe (which i made more scripts for mounting and unmounting a .wim file for editing, like adding drivers) ive made scripts for installing software, i have an entire gaming desktop setup script. I have a script for running battery health reports, adding a new user and optional push them to admin, scripts for updating the base windows apps (especially app installer) i have a script for fixing app installer as ive found some computers without it.

Pretty much anything i can think of that i have to type code over and over again.

I built a NAS script menu that lets me connect to my drive image nas, or our data backup nas and run the programs from there without ever needing to touch filemanager. That one im most proud of.

Just about anything i need that can be done through powershell and cmd im using. Anything to make my job faster and more automated.

0

u/shunny14 Apr 10 '21

It depends on what you mean by scripts.

Most large organizations have a management tool with a way of “scripting” tasks without having to write out a series of commands by hand. You could still tell it to run a power shell script, but you can also use a GUI to provide tasks for it to do.

0

u/[deleted] Apr 10 '21

[deleted] — view deleted comment

4

u/7runx Apr 10 '21

This looks like a direct replacement of AJteks script. Thank god. I’ve been looking for a replacement for a while.

1

u/jcamer Aug 14 '21

I know I'm going back a bit, but is this still available?

0

u/[deleted] Apr 11 '21

[deleted] — view deleted comment

1

u/Carsonbizotica Apr 11 '21

I would love to see that Topaz script if you get a chance. Those things are bane of my existence!