r/PowerShell • 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

50 Upvotes

26 comments sorted by

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

1

u/IJustKnowStuff 3d ago

Well they haven't signed one of the DLL's in the update, so if you have code integrity enabled, it doesn't load.

1

u/BlackV 3d ago

until they break it next month

:)

2

u/Modify- Sep 24 '26 edited Sep 24 '26

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 Sep 25 '26

I believe you'll need V2.41 to get the fix that has now been integrated into the code base.

5

u/BlackV Sep 24 '26

Pretty much the best solution

Version pinning and delay Upgrade for multiple months (lest we forget the broken 2.26 ish version that stayed broken for 2 plus months)

3

u/LookAtMeInMyEyeball Sep 24 '26

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

u/michaelmsonne Sep 24 '26

Yes Stephan managed to crack it 💪

1

u/RikiWardOG Sep 24 '26

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 Sep 25 '26

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 Sep 24 '26

In the PR you can see who created it - and that can’t MS take the credit for

6

u/[deleted] Sep 24 '26

[removed] — view removed comment

1

u/BlackV Sep 24 '26

Alpha*

1

u/[deleted] Oct 15 '26

[removed] — view removed comment

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 15 '26

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

On 2.41.2 now and still getting the fucking error. I hate Microsoft, so, so much.

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 23 '26

Which error?

1

u/rswwalker Oct 23 '26 edited Oct 23 '26

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

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

Is there a tool to see what version of a dependent module a module is built against?

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 24 '26

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

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

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

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.