Retrieve and Export Azure Automation Jobs with All Parameters

This PowerShell script retrieves Azure Automation jobs from the last 7 days for a specific runbook, enriches each job with missing details, normalizes all parameters, and exports everything to a CSV file for easy analysis. This can be incredibly useful for operational monitoring, auditing, and troubleshooting. In many environments, runbooks are triggered with dynamic inputContinue reading “Retrieve and Export Azure Automation Jobs with All Parameters”

Why Set-ADUser Sometimes Fails Right After User Creation

When working with PowerShell in Active Directory, most scripts look simple at first. You create a user, you update some attributes, you add group memberships, and you move on. In reality, things are not always that clean, especially in environments with multiple Domain Controllers. I ran into a situation that looked strange at the beginning.Continue reading “Why Set-ADUser Sometimes Fails Right After User Creation”

Get All Direct and Indirect Reports from Active Directory

This PowerShell snippet retrieves all Active Directory users that report to a specific manager, including all indirect reports, meaning the whole org tree below that manager. This is useful for scenarios like access reviews, license cleanup, delegations, offboarding, team reporting, and automation workflows where actions must apply to an entire reporting line and not onlyContinue reading “Get All Direct and Indirect Reports from Active Directory”

Trigger Azure Automation Runbook with Cloned Parameters

This PowerShell script demonstrates how to re-trigger an Azure Automation runbook using the exact parameters of a previous job, while still allowing you to override individual values before starting the new run. This approach is extremely useful , especially when a runbook failed due to temporary issues or incorrect input. Instead of manually reconstructing allContinue reading “Trigger Azure Automation Runbook with Cloned Parameters”

Automatically renew access token during script execution in PowreShell

Sometimes we encounter scenarios where scripts have a longer runtime. If we are using tokens with expiration time, this can cause issues if the script runs longer than the token’s validity period. I have written a small script that automatically renews the token during script execution. This way, you don’t have to worry about managingContinue reading “Automatically renew access token during script execution in PowreShell”

Trigger Azure Automation Runbooks Using the Azure Management API

  Introduction This lines providing you step-by-step instructions on how to use a PowerShell script to trigger an Azure Automation Runbook using Azure REST API. We will explore each step from setting up authentication to retrieving the execution output of the runbook. Prerequisites Before starting, ensure that you have the following: Azure Subscription: You needContinue reading “Trigger Azure Automation Runbooks Using the Azure Management API”

Reset Microsoft Authentication Methods

Normally, it isn’t much effort to Reset the Multifactor Authentication Methods.Find the User record in Entra ID and require re-registration of the Multifactor Authentication Methods.If you wondering why we need to reset these authentication methods What are the Reasons for an Reset ? But what if you have a big amount of Tickets a dayContinue reading “Reset Microsoft Authentication Methods”

Using RBAC and Application Access Policys for Applications using Exchange Online

As automation heros we are often confronteed with tasks like automating stuff in exchange online. One task we had was not very difficult but also not that straight forward. We are speaking from sending mails over the Graph API. There are multiple aproaches to do it. For sure you can do it wrong and youContinue reading “Using RBAC and Application Access Policys for Applications using Exchange Online”

Send Mails with Graph API – PowerShell

Introduction: In this tutorial, we’ll walk through the process of creating a script to send emails using the Microsoft Graph API. We’ll cover all the necessary steps to set up the script and utilize the Graph API effectively. The methods we’ll use for creating the email body can also be applied to other Graph APIContinue reading “Send Mails with Graph API – PowerShell”

Export System Center Orchestrator PowerShell Scripts

This PowerShell script connects to a SQL Server database, retrieves PowerShell scripts, and saves them to the local filesystem. Parameters Function: Execute-SqlSelectQuery This function executes a SQL query and returns the result. Parameters Expected Result After running the PowerShell script, you can expect to receive a collection of objects representing the results of the SQLContinue reading “Export System Center Orchestrator PowerShell Scripts”