A Scripting Automation Success Story

One day a few months ago a client of mine came to me with a dilemma. They had a massive employee onboarding process that consisted of creating a name badge, providing a laptop and phone, creating an account in their phone system, creating an Active Directory account, a home folder and a lot more activities. Let’s automate it with PowerShell!

The Pain of Manual Labor

The IT director was frustrated because when the process was finally completed, multiple weeks would go by and usually the employee would always request something that the team had forgotten.

The director was at his wit’s end, but someone on his team stumbled across my blog when trying to create an Active Directory account with PowerShell. After building an automated sync process to create new Active Directory accounts from an HR database, he then went on to spill out all of the other things they have to do every time a new employee is hired. It was crazy!

The majority of tasks could be automated like triggering a new employee activity from a database update, creating the Active Directory account, creating the Exchange mailbox, home folder, creating the computer account in Active Directory, etc. But, some tasks simply couldn’t be represented in code.

This was a child company of a larger organization that didn’t give this team access to perform certain activities. Instead, they are forced to open a ticket, assign it to someone in the parent company and wait for the task to be completed before they could complete their onboarding process.

Break Down the Problem

This company used SCCM, and one of the tasks was to move the computer account into a particular collection. Normally, we could have easily have done this with PowerShell but no matter; we’ll just automate whatever we can. Instead of throwing up my hands and griping about politics and how humans get in the way (true by the way), I decided to provide him a solution that he previously didn’t know was possible with “just a script”.

Manual Steps are OK

I was able to determine that the next trigger would be when the ticket was closed. The script would be polling for this as it was waiting. As soon as it detected the ticket was closed, it would proceed as usual.

Unfortunate enough to have another human intervention step? No problem. We just defined the trigger to start, and the trigger to start again and used the data collected along the way to finish out the process!

Too many times in my career I’ve seen small setbacks like this completely derail massive projects. Granted, the director did not know was PowerShell was capable of but also did not stop to come up with a creative solution to the human problem.

Successful scripting automation projects all come down to first documenting a repeatable, standardized process, building the code necessary to perform each task in that process and finally gluing it all together. Just because you encounter a hiccup along the way and the process can’t start at A and end at Z in one script execution doesn’t mean the process can’t benefit from automation.

A 20-year veteran of IT, crypto geek, content creator, consultant and overall problem solver.

A 20-year veteran of IT, crypto geek, content creator, consultant and overall problem solver.