r/PowerShell • MVP, Community Blogger • Oct 05 '26

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/

50 Upvotes

18 comments sorted by

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 06 '26

For the record, the Graph SDK developers released V2.41.1 on 5 October 2026. The new version still has the issues with older versions of PowerShell 7 and Azure Automation reported in the article.

https://www.powershellgallery.com/packages/Microsoft.Graph/2.41.1

4

u/jackmusick Oct 05 '26

What a random and pleasant surprise.

3

u/Childishjakerino Oct 06 '26

It’s so crazy how something like this sits so long lol

1

u/eggeto Oct 05 '26

If you use thé API, you don't have that kind of problems. Just saying 🙂

16

u/Unlikely_Tie1172 MVP, Community Blogger Oct 05 '26

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.

2

u/AdeelAutomates Oct 05 '26

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 Oct 05 '26

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.

→ More replies (1)

6

u/ITGuyThrow07 Oct 05 '26

If I have to do a quick user lookup, Get-MgUser is a lot easier and quicker than going through the API.

6

u/Subject_Meal_2683 Oct 05 '26

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/Andrew-Powershell Oct 05 '26

Anyone that I know who regularly uses graph just calls the API themselves.

2

u/Flettys Oct 05 '26

The most common pattern I see is using only Connect-MgGraph and Invoke-MgGraphRequest

→ More replies (1)
→ More replies (1)

2

u/DeanGullberry Oct 08 '26

Just to save anyone else the headache, if you are (re)installing Microsoft.Graph, add the -Verbose switch so you can see what's happening and know that it isn't just hanging forever (it takes a long time to install all those sub-modules.)

1

u/brownacid 26d ago

Agreed- had it reporting at 100 and killed it an reran w verbose finished but took longer than expected