Skip to content
How to Scale PowerShell Automation using Cloud Runbooks

How to Scale PowerShell Automation using Cloud Runbooks

Written By Anoop C Nair
Last Updated March 24, 2026
Posted In Intune
SHARE

Key Takeaways

  • Runbooks allow scripts to run in the cloud without relying on local devices
  • Automation becomes faster and more scalable using Microsoft infrastructure
  • Application permissions enable secure, user-independent execution
  • Choosing between HTTP requests and modules depends on control vs simplicity

In this post we are discussing the How to Scale PowerShell Automation Using Cloud Runbooks. Mr. Erik Loef discussing in a technical takeoff, that automation has become an essential part, especially handling repetitive tasks like user onboarding, device setup, and reporting. Traditionally, PowerShell scripts have been used locally to perform these actions. While effective, this approach depends heavily on individual devices and manual execution, which can slow down operations.

Table of Contents

How to Scale PowerShell Automation Using Cloud Runbooks

Running scripts locally or asking others to execute them is not always practical, especially in large environments. This is where cloud-based automation steps in, offering a more scalable and efficient solution that reduces dependency on user device.

Why Runbooks

Runbooks eliminate the need to run scripts on local machines. Instead, they execute directly in the cloud, making the process much faster and more efficient. Since they run on Microsoft’s infrastructure, tasks can complete in a fraction of the time compared to local execution. Another advantage is flexibility. Runbooks can be scheduled to run automatically, such as sending daily reports, through webhooks when needed. This reduces manual effort and ensures consistency in operations.

Automating Scripts with Azure Runbooks

This image shows how a PowerShell script can be moved from local execution to cloud-based automation using Azure Runbooks. Instead of running scripts manually on individual devices, runbooks allow you to execute them centrally in the cloud, making the process faster and more scalable.

Patch My PC

To set this up, you create a runbook by defining the name, selecting PowerShell as the runbook type, and choosing the appropriate runtime version. These runbooks can then be connected with a Microsoft Graph application using application permissions, enabling secure, automated execution without user interactions.

BasicsDetails
Name MyGraphRunbook
Runbook typePowerShell
Runtime version 7.2 (recommended)
How to Scale PowerShell Automation using Cloud Runbooks – Table.1
How to Scale PowerShell Automation using Cloud Runbooks - Fig.1 Creds to MS
How to Scale PowerShell Automation using Cloud Runbooks – Fig.1 Creds to MS

Handling Pagination in Graph API

The script initially sends a request using Invoke-MgGraphRequest and stores the first batch of results, then checks for the presence of an @odata.nextLink, which indicates more data is available. Using a loop, it continuously calls the next link to fetch additional pages the result until all data is collected. This approach ensures you don’t miss records when working with large environments, as Graph APIs return data in chunks rather than a single complete response.

How to Scale PowerShell Automation using Cloud Runbooks - Fig.2 Creds to MS
How to Scale PowerShell Automation using Cloud Runbooks – Fig.2 Creds to MS

Device ID Differences Across Platforms

Even though the same device shows up in Intune, Microsoft Entra ID, Defender, and Autopilot, each service gives it a different ID (like Intune Device ID, Entra Device ID, Object ID). These IDs don’t match across platforms, which can be confusing when you’re trying to look up a device or automate tasks.

  • The key point is you need to start from the right platform and know how to map the IDs correctly so you get the right data when working across services.
How to Scale PowerShell Automation using Cloud Runbooks - Fig.3 Creds to MS
How to Scale PowerShell Automation using Cloud Runbooks – Fig.3 Creds to MS

Need Further Assistance or Have Technical Questions?

Join the LinkedIn Page and Telegram group to get the latest step-by-step guides and news updates. Join our Meetup Page to participate in User group meetings. Also, join the WhatsApp Community  and the Whatsapp channel to get the latest news on Microsoft Technologies. We are there on Reddit as well.

Author

Anoop C Nair is a Workplace Technology solution architect with 25+ years of experience. Microsoft Certified Trainer. Microsoft MVP from 2015 onwards for consecutive 11+ years! He is a blogger, Speaker, and Founder of HTMD Community and HTMD Conference. His main focus is on Device Management technologies like Intune, Windows, and Cloud PC. He writes about technologies like Intune, SCCM, Windows, Cloud PC, Entra, and Microsoft Security.

Written by

Anoop C Nair is Workplace Technology solution architect with 25+ years of experience in global enterprise organizations such as JP Morgan, Capgemini, etc. Microsoft Certified Trainer. Microsoft MVP from 2015 onwards for consecutive 11+ years! He also conducts Intune and modern workplace tech training for enterprise organizations. He is Blogger, Speaker, and Founder of HTMD Community and HTMD Conference. His main focus is on Device Management technologies like Intune, Windows, Cloud PC. He writes about technologies like Intune, SCCM, Windows, Cloud PC, Windows, Entra, Microsoft Security.

Discussion

Join the discussion

Your email address will not be published. Required fields are marked *

Related guides

Intune

Simplify Windows Devices to Run Only the Required Applications using Intune

Key Takeaways Hey, let’s learn about Simplify Windows Devices to Run Only the Required Applications using Intune. This policy lets administrators replace the default windows shell with a custom or lightweight shell. it improves performance by using system resources and is useful for devices that run a dedicated application. If the policy is disabled or […]

AC Anoop C Nair 8 min read
Intune

Enhance macOS Compliance with Custom Security and Compliance Checks to Improve Device Security using Microsoft Intune

Key Takeaways In this post we are discussing about Enhance macOS Compliance with Custom Security and Compliance Checks to Improve Device Security using Microsoft Intune. Microsoft has announced the general availability of Custom Compliance Settings for macOS in Microsoft Intune. The feature helps organizations strengthen security controls while supporting many types of macOS management scenarios. […]

AC Anoop C Nair 4 min read
Intune

Manage Samsung Galaxy Firmware Versions to Improve Security and Compliance using Microsoft Intune

Key Takeaways In this post we are discussing Manage Samsung Galaxy Firmware Versions to Improve Security and Compliance using Microsoft Intune. Microsoft Intune has received a new update that expands firmware management capabilities for Samsung Galaxy devices through Firmware Versionsintegration. This enhancement gives IT administrators more control over firmware and operating system updates, helping them […]

AC Anoop C Nair 4 min read
Intune

MS Intune Adds Windows Registry Data Collection to Device Inventory for Single Values All Key Values and Subkeys

Key Takeaways Microsoft Intune 2607 introduces Windows Registry Data collection in Device Inventory, allowing IT admins to verify actual device configurations without relying on custom discovery or remediation scripts. Using the Properties Catalog, admins can collect registry information through Single Value, All Values Under a Key (Non-Recursive), or Same Value Across Subkeys. MS Intune Adds […]

AC Anoop C Nair 5 min read