I have recently moved back to managing a Microsoft environment after several years in Google Workspaces. When I first got to the Google shop, I missed Microsoft. When I first came back to MS, I missed Google. I don't know. My time at the Google shop showed me the joys of automating through APIs versus locally running PowerShell scripts. It was great; I could automate everything, even the gigabytes (first of many obscure references to 90s TV and movies).
In an effort to get back to my automating ways, I began to work with Microsoft’s Graph API. Things were good, at least until the maintenance of a certain distribution group came up. So, I can manage some of the groups with API and the rest need PowerShell? WHY!? Could they not borrow one more mind for this meeting, or were they all being used for the constant rebranding of products?
Stepping back from a possible rant,, this has led me to discover Azure Runbooks and the point of this article. If you need to automate your PowerShell tasks and your company has moved on from the late 2000s to be a cloud-only shop, this is a great way to bridge the gap. Below I have given a quick run through of setting up your first runbook. There are plenty more use cases than this, but having the ability to run PS scripts on demand without the use of a Windows box is pretty nice. This is the article from MS I used to follow, Tutorial: Create a PowerShell Workflow runbook in Automation. Swap out the Powershell script provided with one that suit your needs and be sure to add any additional modules yours may require. And remember, always do some of your own research before blindly following a step by step of some dude on the internet. You start doing that and next thing you know, money is missing out of your dresser drawer and your daughter’s knocked up.
Creating Your First Playbook to Run a PowerShell Script for Removing a User from a Group
param (
{
Conclusion
Don’t lose hope, there are still ways to automate in a Microsoft environment through webhook payloads. You just sometimes have to do it twice, once in Graph and once in PS. Seriously MS, why!?.
This article is a guest post written by Cole Erickson, an independent author. The views and opinions expressed are solely those of the author and do not reflect those of Foqal. Foqal assumes no responsibility for the accuracy, completeness, or validity of any information contained within this article and is not liable for any reliance on the content. For any queries related to this article, please contact the author directly.
Get the latest insights on IT operations, AI, and workplace productivity delivered to your inbox.
See how Foqal can help your team deliver faster, smarter support.
Start Free Trial