There are a few universal truths in this world: the sun will rise again tomorrow, you will eventually come to scoff at what “kids call music today” and you will never have as many resources at your disposal as you would like.

But there’s always scripting: if you get sufficiently clever with how you set things up, it’ll be as if you secretly hired a robot underling to do your bidding (Though we don’t actually recommend making your scripts beep like R2D2).

While writing scripts is primarily a time saving automation feature, there are (at least) two big additional benefit:

  1. Scripts are executable documentation. Instead of following a checklist on how to add new users to the network, applications, permissions, etc., a script will add every user the same way every time.
  2. Scripted tasks simplify testing in a staging environment. It’s much better for your sanity to spin up a few VMs, develop and test the script against the staging environment until it is perfect, and then push it over to production when you’re confident of the outcome.

Powershell

If you’re working mostly with Windows, you are going to be writing PowerShell . Lucky for you: PowerShell is awesome – here are some guides to get started:

Dive Right In

Open PowerShell and enter `get-help` and learn PowerShell from the help files like people did before we had the Internet. Bonus points if you have MSDN subscription CDs still kicking around from a decade ago.

Microsoft Virtual Academy

https://mva.microsoft.com/en-us/training-courses/getting-started-with-powershell-3-0-jump-start-8276?l=r54IrOWy_2304984382

Technet’s PowerShell for Beginners

http://social.technet.microsoft.com/wiki/contents/articles/4307.powershell-for-beginners.aspx

More resources at: https://blog.varonis.com/top-10-powershell-tutorials-on-the-web/

Bash

You haven’t lived until you’ve tried debugging a faulty 3,000 line shell script.

Shell scripting (typically with bash, but read up on the difference between sh and bash before jumping in) has been a deep part of unixlike system administration from the beginning.

The Unix Way

http://www.catb.org/esr/writings/taoup/html/ch01s06.html

Bash How-To

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

Bash Guide for Beginners

http://www.tldp.org/LDP/Bash-Beginners-Guide/html/

← Go back to the intro