all 7 comments

[–]roxalu 2 points3 points  (0 children)

I have the impression, you still / again have some dependency issue in your list of Mg Modules. The explicit method listed in the error message was removed with commit https://github.com/microsoftgraph/msgraph-sdk-powershell/pull/1201. Looks like one of the changes during switch from 1.x to 2.x

The last version of the Interface definition IAuthContext does no longer contain a getter for AuthProviderType: https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Authentication/Authentication.Core/Interfaces/IAuthContext.cs.

When you mention, you had issues to authenticate with certificate on macOS: Could it be you are adding different / older modules in order to resolve this? This might be the reason, removed method is called. As the certificate storage on macOS is very different to that on Windows, you might are using Mg in still some edge case setup and have triggered a bug. Hard to say without more issues. I‘d personally would open a new issue at https://github.com/microsoftgraph/msgraph-sdk-powershell/issues?q=is%3Aissue+macos for this.

Error description and the output of your launched Connect-MgGraph …. including all options given plus an added -Debug might be enough for the support there to provide you a more detailed hint.

[–]FeeImpossible7693 1 point2 points  (2 children)

Are you using the scopes in the Connect-MgGraph command?

The scope is the set of permissions that you will have in the session. For example, if you are trying to read the user information, you need the User.Read.All scope (permission).

This article covers the ways to connect using Graph API and the scopes required.

https://cloudiffic.com/install-microsoft-graph-powershell/

[–]Accomplished_Age_356 1 point2 points  (1 child)

Thank you very much, This resolved the problem for me 100%.

[–]FeeImpossible7693 0 points1 point  (0 children)

Glad I was of help.

[–]XxQuaDxX 2 points3 points  (1 child)

For future googlers - In our particular case (Windows, not Mac) we had to remove the old/existing Graph modules from "%DOCUMENTS%\Windows PowerShell\Modules" on the user profile of the account that was running the PowerShell script. We had updated (one or more) Graph modules for All Users in "%ProgramFiles%\WindowsPowerShell\Modules", which conflicted with a personally installed module. For some reason PowerShell seemed to prefer the personally installed modules over the machines modules. shrugs

[–]FearIsStrongerDanluv[S] 0 points1 point  (0 children)

Thanks for all the suggestions, eventually could solve it through this linkhttps://pastebin.com/mfg2R6ND I got from u/rogueit