Automating Microsoft 365 with PowerShell Update #11
Over 300 Pages of Microsoft 365 PowerShell Goodness to Read

The Office 365 for IT Pros writing team are pleased to announce the availability of update 11 for the Automating Microsoft 365 with PowerShell eBook. The eBook is part of the Office 365 for IT Pros (2025 edition) bundle and is also available separately (PDF and EPUB formats) or from Amazon in Kindle and paperback formats. The current version is dated 24 April 2025 and has the version number 11.1.
We typically release an updated version of Automating Microsoft 365 with PowerShell several days before the release of the monthly update of the Office 365 for IT Pros eBook. This approach makes it easier for us to manage the updates for the “big book.” We anticipate that monthly update #119 for Office 365 for IT Pros will be available on May 1.
Subscribers to the Office 365 for IT Pros bundle or to the Automating Microsoft 365 with PowerShell eBook can download the latest files by using the link in the receipt sent to them from Gumroad.com after their original purchase. See our FAQ for more details about how to download updated book files.
New Microsoft Graph PowerShell SDK Version
Microsoft released V2.27 of the Microsoft Graph PowerShell SDK on April 20. This is an important update because it had to address the many woes inflicted on customers with the buggy V2.26 and V2.26.1 releases. Azure Automation runbooks remain an issue (stay with V2.25 if you want to use PowerShell V7.1 or V7.2 runbooks) that will be addressed when Microsoft ships support for PowerShell V7.4 for Azure Automation on June 15, 2025. Two issues must be cleaned up: a clash between the SDK and Exchange Online PowerShell and support for .NET 8. In the interim, V2.27 runs fine with V5.1 runbooks.
License Assignment Bug
After several days of intensive work with V2.27 in interactive and app-only modes, I haven’t noticed any of the obvious flaws that affected its predecessors. Some early cmdlet oddities were cleared up by rebooting my PC. These were likely due to some lingering older components hanging on in memory. Following the reboot, all is well. Then I heard about problems with the Set-MgUserLicense cmdlet (issue #3286) where new licenses cannot be assigned to accounts. It seems like the cmdlet has problems parsing the information passed in the AddLicenses parameter. However, passing the license data in a body parameter works:
$LicenseData = @{ addLicenses = @( @{ disabledPlans = @() skuId = "f30db892-07e9-47e9-837c-80727f46fd3d" } ) removeLicenses = @() } Set-MgUserLicense -Userid $User.id -BodyParameter $LicenseData
Speaking of bugs, if you encounter a problem with V2.27, please report details of the issue and steps to reproduce the problem via the GitHub repro for the SDK. Reporting an issue doesn’t take long and it is really helpful to have issues documented. Microsoft engineering monitors the open issues list and does their best to respond to problems that might affect many customers (like the license issue described above). If you don’t report problems, don’t complain when an SDK cmdlet doesn’t work the way you expect it to.
On to The Next Update
The Automating Microsoft 365 with PowerShell eBook is now well over 300 pages. That’s quite a change from the first version published in July 2024. There’s lots to cover in the next update, including a look at the newly-introduced Graph API usage report API. The API is still in beta and only covers certain parts of Graph usage such as Exchange Online and Teams messaging. The output lacks refinement and doesn’t throw any detailed light into how the Graph APIs are used within a Microsoft 365 tenant. Going forward, that situation is likely to change. It will be interesting to see the usage data generated by Microsoft and how that data is used.
Need some assistance to write and manage PowerShell scripts for Microsoft 365? Get a copy of the Automating Microsoft 365 with PowerShell eBook, available standalone or as part of the Office 365 for IT Pros eBook bundle.