EPISODE · Dec 9, 2025 · 22 MIN
PowerShell Microsoft Graph API: No Modules, No Dependencies, No Limits
from M365.FM - Modern work, security, and productivity with Microsoft 365 · host Mirko Peters - Founder of m365.fm, m365.show and m365con.net
(00:00:00) The Future of PowerShell Scripting (00:00:24) The End of Modules (00:00:41) REST API: The Better Alternative (00:03:39) Token Acquisition Methods (00:04:48) The Core REST Pattern (00:05:34) Common Mistakes to Avoid (00:06:23) Quick Wins with Graph (00:07:20) Enterprise Demo 1: Intune Device Cleanup (00:10:22) Enterprise Demo 2: Identity Onboarding (00:13:16) Enterprise Demo 3: Compliance Drift Detection In this episode of M365.fm, Mirko Peters shows how to drop legacy PowerShell modules like MSOnline and AzureAD and move to a clean, REST‑first pattern with Microsoft Graph that runs anywhere — Windows, Linux, containers, and CI/CD.WHAT YOU WILL LEARNThe API‑first, module‑free PowerShell pattern for Microsoft GraphThree real‑world auth flows (device code, certificate, Managed Identity) and when to use eachHow to build scripts that survive Linux runners, containers, and cloud automation environmentsHow to implement paging, throttling, and retries correctly with Invoke‑RestMethodA simple Graph “gotcha” that silently breaks most scripts — and how to avoid it foreverWhy security, RBAC, and least‑privilege app registrations love this approachHow to sell this shift to your security team and leadershipTHE CORE INSIGHTModules lag, Graph is always first. If a feature exists in Microsoft 365, it lands in Microsoft Graph before it ever shows up in a PowerShell module — if it shows up at all.By going REST‑first, you stop fighting module versions, dependencies, and platform differences and instead build small, predictable scripts that talk to Graph directly.Tokens replace credentials, short‑lived access replaces shared service accounts, and your scripts suddenly become audit‑friendly and automation‑ready.This episode argues that the future of serious automation in Microsoft 365 is PowerShell + REST + Graph — not another generation of fragile modules.WHY POWERSHELL WITHOUT MODULES WORKSGraph is the single, consistent API surface behind the Microsoft 365 portals you already usePowerShell Core plus Invoke‑RestMethod works on Windows, Linux, containers, GitHub Actions, and Azure FunctionsAuth is standardized: OAuth2, certificates, and Managed Identity instead of stored passwordsYou can control scopes and app permissions with precision, then review them on a scheduleObservability improves: every call has request IDs and correlation IDs in standard logsYou reduce your dependency on third‑party module maintainers and “works on my machine” setupsKEY TAKEAWAYSStop importing legacy modules for new automation — design against Microsoft Graph directlyUse device code auth for local dev, certificates for headless jobs, and Managed Identity for Azure‑hosted workloadsCentralize retry, pagination, and throttling handling into a few reusable helpersKeep permissions tight: grant only the Graph roles each job actually needsTreat tokens as disposable, auditable access — not as a convenience hackDesign your scripts for CI/CD and cloud from day one, not just for your laptopWHO THIS EPISODE IS FORThis episode is ideal for Microsoft 365 admins, automation engineers, DevOps teams, and cloud architects who rely on PowerShell for identity, Intune, and tenant operations.If your scripts still import MSOnline or AzureAD, or if CI/CD runners keep breaking your module‑based automation, this conversation will show you how to modernize with a Graph‑first approach.TOPICS COVEREDPowerShell + REST + Microsoft Graph as a universal patternDevice code, certificate, and Managed Identity auth flows in practiceHandling paging, throttling, and retries with Invoke‑RestMethodEnterprise‑grade Intune device cleanup without any modulesSecurity, RBAC, and observability benefits of token‑based automationCommon pitfalls when migrating from modules to Graph and how to avoid themABOUT THE HOSTMirko Peters is a Microsoft 365 consultant and digital workplace architect focused on building cloud‑native, automation‑ready environments on the Microsoft stack.Through M365.fm, Mirko shares practical patterns, governance approaches, and real‑world scripts that help IT teams move from legacy modules to modern, Graph‑first automation.Become a supporter of this podcast: https://www.spreaker.com/podcast/m365-fm-modern-work-security-and-productivity-with-microsoft-365--6704921/support.
What this episode covers
(00:00:00) The Future of PowerShell Scripting (00:00:24) The End of Modules (00:00:41) REST API: The Better Alternative (00:03:39) Token Acquisition Methods (00:04:48) The Core REST Pattern (00:05:34) Common Mistakes to Avoid (00:06:23) Quick Wins with Graph (00:07:20) Enterprise Demo 1: Intune Device Cleanup (00:10:22) Enterprise Demo 2: Identity Onboarding (00:13:16) Enterprise Demo 3: Compliance Drift Detection In this episode of M365.fm, Mirko Peters shows how to drop legacy PowerShell modules like MSOnline and AzureAD and move to a clean, REST‑first pattern with Microsoft Graph that runs anywhere — Windows, Linux, containers, and CI/CD.WHAT YOU WILL LEARNThe API‑first, module‑free PowerShell pattern for Microsoft GraphThree real‑world auth flows (device code, certificate, Managed Identity) and when to use eachHow to build scripts that survive Linux runners, containers, and cloud automation environmentsHow to implement paging, throttling, and retries correctly with Invoke‑RestMethodA simple Graph “gotcha” that silently breaks most scripts — and how to avoid it foreverWhy security, RBAC, and least‑privilege app registrations love this approachHow to sell this shift to your security team and leadershipTHE CORE INSIGHTModules lag, Graph is always first. If a feature exists in Microsoft 365, it lands in Microsoft Graph before it ever shows up in a PowerShell module — if it shows up at all.By going REST‑first, you stop fighting module versions, dependencies, and platform differences and instead build small, predictable scripts that talk to Graph directly.Tokens replace credentials, short‑lived access replaces shared service accounts, and your scripts suddenly become audit‑friendly and automation‑ready.This episode argues that the future of serious automation in Microsoft 365 is PowerShell + REST + Graph — not another generation of fragile modules.WHY POWERSHELL WITHOUT MODULES WORKSGraph is the single, consistent API surface behind the Microsoft 365 portals you already usePowerShell Core plus Invoke‑RestMethod works on Windows, Linux, containers, GitHub Actions, and Azure FunctionsAuth is standardized: OAuth2, certificates, and Managed Identity instead of stored passwordsYou can control scopes and app permissions with precision, then review them on a scheduleObservability improves: every call has request IDs and correlation IDs in standard logsYou reduce your dependency on third‑party module maintainers and “works on my machine” setupsKEY TAKEAWAYSStop importing legacy modules for new automation — design against Microsoft Graph directlyUse device code auth for local dev, certificates for headless jobs, and Managed Identity for Azure‑hosted workloadsCentralize retry, pagination, and throttling handling into a few reusable helpersKeep permissions tight: grant only the Graph roles each job actually needsTreat tokens as disposable, auditable access — not as a convenience hackDesign your scripts for CI/CD and cloud from day one, not just for your laptopWHO THIS EPISODE IS FORThis episode is ideal for Microsoft 365 admins, automation engineers, DevOps teams, and cloud architects who rely on PowerShell for identity, Intune, and tenant operations.If your scripts still import MSOnline or AzureAD, or if CI/CD runners keep breaking your module‑based automation, this conversation will show you how to...
NOW PLAYING
PowerShell Microsoft Graph API: No Modules, No Dependencies, No Limits
No transcript for this episode yet
Similar Episodes
Mar 26, 2026 ·1m
Mar 19, 2026 ·34m
Feb 18, 2026 ·11m
Feb 11, 2026 ·45m