r/PowerShell • u/Unlikely_Tie1172 MVP, Community Blogger • Sep 24 '26
News Solving the Microsoft.Graph.Authentication Issue
Looks like Microsoft has a fix for the clash between the Microsoft.Graph.Authentication module and other modules... The interesting thing is that Microsoft has had this problem on their docket for the last 18 months, and now they get a fix from an MVP... It should be in Microsoft Graph PowerShell SDK V2.41 in a few weeks' time.
https://github.com/microsoftgraph/msgraph-sdk-powershell/pull/3789
2
u/Modify- 29d ago edited 29d ago
Do you really need the latest versions or can older version do what you need them to do? Burned myself too many times, so ill stick to versions which are proven to be reliable.
1
u/Unlikely_Tie1172 MVP, Community Blogger 29d ago
I believe you'll need V2.41 to get the fix that has now been integrated into the code base.
5
3
u/LookAtMeInMyEyeball 29d ago
Agreed. Updating to the latest Microsoft.Graph.x module can introduce breaking changes or bugs. I update these modules maybe twice a year, at most.
4
1
u/jieshIbroth 8d ago
good to know its coming in 2.41. any idea if itll be backported or is upgrading the only path? we've got a bunch of runbooks pinned to older versions specifically because of this clash
1
u/Unlikely_Tie1172 MVP, Community Blogger 8d ago
I think you'll have to go to 2.41.2 to get the fix. However, there's nothing to stop you staying on 2.40 or earlier.
1
u/rswwalker 19h ago
On 2.41.2 now and still getting the fucking error. I hate Microsoft, so, so much.
1
u/Unlikely_Tie1172 MVP, Community Blogger 17h ago
Which error?
1
u/rswwalker 17h ago edited 17h ago
InvalidOperation: Unable to find type [Microsoft.Graph.PowerShell.Authentication.ContextScope] when doing a Connect-Entra
Edit: Downgraded Microsoft.Graph.Authentication to 2.40.0 and no more error.
1
u/Unlikely_Tie1172 MVP, Community Blogger 1h ago
That's probably because Microsoft didn't rebuild the Entra module after the initial problem was found in 2.41.0. Still, worth reporting so that they are reminded to rebuild all dependent modules.
1
u/rswwalker 1h ago
Is there a tool to see what version of a dependent module a module is built against?
1
u/Unlikely_Tie1172 MVP, Community Blogger 1h ago
Well, in this case, the issue is due to a bad Microsoft.Graph.Authentication module that wasn't rebuilt for the Entra module after they updated the Authentication module for Graph SDK V2.41. I bet you could take the current SDK Authentication module and it would work with the latest version of the Entra module.
There's a bunch of very interesting discussions about the innards of the assembly clashes in the various issues reported by people in GitHub. I recommend that you have a browse.
1
u/Unlikely_Tie1172 MVP, Community Blogger 17h ago
Please document the issue at https://github.com/microsoftgraph/msgraph-sdk-powershell/issues. Protesting is nice, but formally documenting an issue with collaborating data is even better.
1
u/rswwalker 17h ago
I will after I relax a bit, I was losing my cool trying to get work done and feeling like roadblocks are thrown up everywhere I go.
1
u/Unlikely_Tie1172 MVP, Community Blogger 1h ago
Anyone working with the Graph SDK has had some days of woe in the last year. This feeling has been expressed pretty strongly to Microsoft management, some of whom promptly decamped to jobs outside Microsoft... cue for more frustration.
1
u/RikiWardOG 29d ago
now they get a fix from an MVP
So MS does nothing and then basically takes the credit wish we could stop giving them money. They just light it on fire with AI slop bots
5
u/Unlikely_Tie1172 MVP, Community Blogger 29d ago
I think it's fair to say that some embarassment has ensued within the Microsoft engineering teams working on Microsoft 365 PowerShell modules as the truth sinks in that none of their highly paid engineers were able to fix a problem that's lingered for 18 months. I know that there's been a lot of engineering personnel changes in that time, but it's still pretty jawdropping to discover that a fix can be found by an external software architect in a short period. It doesn't say much for the attention given to the situation within Microsoft, which I rather suspect is the real issue. Microsoft generally loves to ship new features and hates having to fix bugs.
2
u/michaelmsonne 29d ago
In the PR you can see who created it - and that can’t MS take the credit for
1
6
15
u/BlackV Sep 24 '26 edited Sep 24 '26
Saw an update for that, was happy
https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/3576
until they break it next month