There is never enough time in the day for all the activities we want to fit in, and some tasks inevitably slip down the to-do list with a “lack of time” note attached. We can reclaim lost hours and accomplish a few more things on our to-do list through automation of mundane tasks, leaving more time to focus on our passions.
As developers and technology professionals, it probably isn’t going to be hard to convince you that automation is a great idea. However, I’m not here to focus on large-scale, enterprise-grade automation projects. Instead we’ll focus on how automating simple things will give us more time to focus on everything else.
In this Guide you will learn:
How implementing automation within common tasks can help improve job satisfaction and reduce wasted time.
How to implement key examples of automation tooling.
Best practices for getting the most out of incremental automation.
Think small to achieve big
When people first mention automation, our brains go straight to robots—or at least mine does. We picture a complex manufacturing process that usually requires the cooperation of a team of skilled machinists and hours of time. Next, we imagine waving an automation wand at the problem and robots magically completing the task with improved efficiency and reduced cost. We often think of this level of automation within our IT organizations as well: big complex processes with a lot of human interaction and handoffs instead completed by computers. This is automation—but not the kind I want to talk about today.
We need to think much smaller to solve common day-to-day problems and find more time in our days. Consider the Outlook rules that automatically process emails by certain people or about specific subjects, or the Power Automate flows that help streamline document approvals or schedule reminders to avoid interrupting heads-down work. It also includes those scripts that you’ve written to quickly complete repetitive tasks instead of having to click through a slow GUI and manually type in responses. These are the kinds of solutions that, when aggregated, provide significant time savings throughout your day.
Automation tooling
One of the great things about the automation industry is the rapid release of new functionality and tooling. Older tools are updated regularly, and new and innovative tools are frequently released. Below is a collection of recommended tooling options with an overview of how they save time.
PowerShell and APIs
My background as a SQL Server database administrator on a Windows operating system means PowerShell is usually my weapon of choice for automation. Overhauled in the last few years, PowerShell is both cross-platform and open source. These changes have brought not only a ton of great new features but the ability for folks like me, who predominantly use Windows, to be now able to automate across Mac and Linux OS.
Another automation use case for PowerShell applies to any service that makes a REST API available. PowerShell can easily send requests to APIs, creating many automation options. There are APIs available that allow you to interact with Twitter, get the current weather, or even check on local crime reports. Many of the services you use daily have APIs. For example, Slack’s API allows you to send messages to channels. Your timesheet app might have an API, which means you can update the time you’ve worked on certain projects directly from PowerShell. Once you discover APIs, the possibility for automation grows even more prominent.
Website automation
If there isn’t an API available, there are still options for automation. Seleniumallows you to automate any task where you access a website. For example, you could automate the task of reordering products when inventory gets low in your stock inventory system. You could also use Selenium to load Google Maps and calculate the distance between two locations and how long it would take to get there.
Selenium provides many options for automation where it would otherwise not be possible. Anywhere you can load a website, click some buttons, or enter some text, Selenium can help.
GitHub Actions
Another tool worth mentioning is GitHub Actions, which allows you to automate documentation, run tasks against your code and repos within GitHub, or even schedule tweets. One great use case is to automate testing of your code changes: Chrissy LeMaire, a Microsoft MVP and GitHub Star, has written a guide that I’d recommend reading called Coding peace of mind: A guide to testing. This shows how we can test our code on every push and ensure we haven’t broken anything.
Think slow and steady
The tools we discussed in the previous section are great, and I’m sure the ideas are flowing for all the tasks you can automate. However, we already noted not having enough time in our day, so when are we supposed to write all these fantastic automation scripts? This is where the idea of incremental automation comes in. We don’t have to automate super complex processes immediately; instead, we find small bite-sized tasks that we do often, and automate those first.
As we automate these small tasks, we’ll get more time back to assign to our next automation project. It’s also worth mentioning that automating tasks not only means that we don’t have to do them each day manually, but that it’s also (most likely) going to be completed more reliably by computers than by humans. The computer isn’t going to be tired on a Monday morning and type in the wrong value, which saves us troubleshooting time. Anyone who has stared at an error message for hours only to realize a word is spelled wrong, or a rogue comma has appeared, will appreciate this!
As a database professional, one of the first tasks that I think about every morning is whether all my databases were backed up successfully overnight. It’s easy to check this with SQL Server. You can open SQL Server Management Studio (SSMS), connect to your SQL instance, navigate to jobs, and check for failures. It doesn’t take that long for one instance, but if you have even a few instances, that time adds up quickly. You can easily automate this task with dbatools, an open source PowerShell module written by the open source community.
Using PowerShell for this task means it’s easy to check the backups for both one SQL Server and ten or even 100+ SQL Servers. We can also take this one step further on our automation journey and run this as a scheduled task each morning, perhaps only alerting us if there is a problem. We could even use the slack API to report results into a channel we monitor.
Incremental automation in practice
A great example of incremental automation in my life relates to the morning reports we discussed automating. The time that automating these reports saves every morning can now be used to automate the next task, perhaps looking for failed SQL Server Agent jobs. Again, using dbatools, we can quickly pull together a list of any jobs that need our attention and add that detail to the morning report with the backup status.
Now that two of our morning tasks are running automatically, we can move on to a third and fourth. Before long, we have a pretty comprehensive report that can run while we’re making the perfect cup of coffee. If issues are highlighted in our report, we know exactly where we need to focus our attention.
As you embrace this process, you’ll find many small tasks worth automating, and the more you automate, the more time you’ll claim back for more automation work.
Automation benefits
The pros of automation are clear. When you go on a magnificent holiday to a remote island, you don’t have to worry that no one is checking the backups. You don’t even need to worry about ensuring processes are running as expected: The automation you put in place will keep doing this for you, alerting your team if action is needed.
Also, as previously mentioned, automating tasks can be more reliable than having humans complete them. Of course, we have to write good scripts with proper error handling, but if we do, we can be confident about completing the task in the same fashion every time.
One final benefit I’ve found from automation is community involvement. Getting involved in the dbatools project, I’ve met many open source contributors who are passionate about the same idea as me: doing less manual work. I’ve made friends who I can turn to for advice when writing more complicated scripts and processes, and I can then share the scripts I create to help others. Everybody wins.