After learning some PowerShell scripting fundamentals, I struggle to structure the questions about what I should be looking to automate at work. Ultimately, I would like to automate anything and everything but I am failing to understand where PowerShell is the right tool for the job. Beyond that understanding of what can and should be automated with PowerShell.
Any advice on how I can leverage PowerShell to its fullest is greatly appreciated.
So you want to substitute yourself with a bunch of PowerShell scripts, right?
It depends pretty much on what your actual job is. I’d pick something small you do over and over but does not need any creativity - something recurring boring.
15 years ago I started a job where I had to check about 8 to 10 server every day if the locally installed backup solution did its job last night. The admin showing me my task logged on to each individual server, started the backup software, checked the state and logged of … physically in the server room.
I told myself - that’s not what they hired me for. So I set up the backup software to log the status to the eventlog, created a script I could run from my computer to check all the eventlogs of the servers remotely and output the results in a nice table. It took me a while back then but it saved me about 20 min of work every day since then.
I mainly do help desk tasks: creating new users in AD and O365 or Exchange, installing software, computer maintenance, troubleshooting printers and a wide array of different software, PBX changes.
We recently started a standardization project with one of our smaller organizations and once completed will do the same for all of the other organizations we support. I am hoping to add automation into this process but am still just learning how to make all of the changes for the standardization.
Most of the tasks like this are done by our team in an early time zone (Server reboots, etc…) And our backups are done by either barracuda or Veeam.
I understand that is meant to be one specific example of a repetitive task that can be automated easily, which are exactly the things I will want to start my automation with, I just have not found one yet
Take the first one for example. How many steps do you do to create a new user? This might be faster with a good designed script. And since you can set up some rules it could be more reliable and consistent than doing it manually in a GUI. Especially when more than one admin working with this.
This is worth pursuing for the experience alone and perhaps terminations as well. I had considered this task before but as each takes a max of five minutes I have held off. For the experience and the increased reliability/consistency, I am sold on doing this as my first automation project. In the perfect world, this script could run without having to sign into a server or even send the email with the credentials to their hiring manager.
Do you imagine this set of steps, or perhaps another solution to any particular step would be possible?
Open VPN connection
Create PSRemote Session
Invoke-Command for the account creation steps (AD and Exchange where applicable)
Connect to Office 365 and create an email account (where applicable)
Closing VPN connection
Send an email to the requestor with credentials
I had tried setting up emailing with PowerShell in the past and greatly failed so that may be a discussion for another day. The other steps seem reasonable, minus the opening and closing of the VPN connection with PowerShell as I have not looked into this before.
It always depends on the particular circumstances. But at least for the steps 2 to 4 should it be easy to use a script. And it does not have to perfect from end to end in the first step. Just start with one step at a time. If it’s not for speed it could be for consistency.