r/PowerShell • u/Unlikely_Tie1172 MVP, Community Blogger • 1d ago
News Microsoft Graph PowerShell SDK V2.41 Finally Fixes Assembly Clash
The Microsoft Graph PowerShell SDK has long been plagued by assembly clashes that meant it couldn’t be used in the same session as other Microsoft 365 modules. After Microsoft engineering groups looked at the problem for 18 months, a solution was found by MVP Stephen van Rooij and is now available in V2.41. Apart from an issue with old PowerShell V7 versions (which affects Azure Automation runtime environments), the fix looks solid and the SDK can once again be loaded into PowerShell sessions alongside the Exchange Online and Teams modules.
https://office365itpros.com/2026/10/05/microsoft-graph-powershell-sdk-fix/
1
u/eggeto 1d ago
If you use thé API, you don't have that kind of problems. Just saying 🙂
15
u/Unlikely_Tie1172 MVP, Community Blogger 23h ago
Which is fine for professional developers. The SDK is really targeted at Microsoft 365 tenant admins (such as the folks who have used the Exchange module for years) to automate common admin processes without having to worry about token acquisition and refresh, pagination, and throttling (mostly), all of which need to be taken care of when using raw Graph API calls.
1
u/AdeelAutomates 17h ago
Unrelated, but I just want Exchange Online to get a proper API that exposes everything available through the Exchange module, not just bits and pieces the current exchange API offers.
Graph has made the rest of M365 so much easier to automate. Exchange still feels like the odd one out.
1
u/Unlikely_Tie1172 MVP, Community Blogger 16h ago
The Exchange team has been asked for this capability for many years. They haven't delivered, but to be fair, they have been preoccupied in getting customers off the EWS API. That's why we now have the mailbox import-export Graph API and why some of the gaps in the mailbox, calendar, contacts, etc. API have been addressed. And I guess I could add the Exchange admin API to the list, but that's just a wrapper around PowerShell cmdlets that exists to help get some ISVs off EWS.
1
u/justinwgrote 15h ago
Actually if you inspect the traffic, everything in the Exchange Online modules does go thru a REST API now, albeit a clunky one. It literally sends the command and arguments in the POST and then gets CLIXML back :)
6
u/ITGuyThrow07 20h ago
If I have to do a quick user lookup, Get-MgUser is a lot easier and quicker than going through the API.
7
u/Subject_Meal_2683 1d ago
Performance (and dependency) wise making the api calls yourself using Invoke-Restmethod is much better. When I was writing a lot of scripts which depended on Graph I dropped the Graph module dependency because it was so slow compared to scripts where I did most of the heavy lifting myself. Of course, on small tenants it doesn't make a huge difference but since I also work with tenants that have over 100k users every millisecond I win is a lot.
(And of course, the tradeoff is having to do more of the heavy lifting myself, anti throttling code, retry logic... so it's the tradeoff between "easy" and "robust and performance")
1
u/Federal_Ad2455 19h ago
Without using graph api json batching you are just half way there 🙂 for large tenant it is a must
1
u/Andrew-Powershell 16h ago
Anyone that I know who regularly uses graph just calls the API themselves.
1
u/Flettys 16h ago
The most common pattern I see is using only Connect-MgGraph and Invoke-MgGraphRequest
2
u/Andrew-Powershell 12h ago
Have you heard of EntraAuth? I'm a fan https://github.com/FriedrichWeinmann/EntraAuth
1
2
u/jackmusick 12h ago
What a random and pleasant surprise.