Issues with PowerShell Graph Commands and Client ID Errors

0
1
Asked By TechExplorer88 On

I'm having trouble running various Graph commands in PowerShell after successfully connecting using my credentials with 'connect-mggraph'. I see that 'get-mgcontext' gives me all the right details like the client ID and tenant ID, but when I try to execute commands like 'get-mguser', I encounter an error. The error appears in an interactive auth window that states: 'AADSTS900144: The request body must contain the following parameter: 'client_id'.' I've attempted to resolve this by uninstalling and reinstalling the Graph modules, rebooting my system, and even switching devices and apps (from ISE to VSCode), but nothing has worked. Any suggestions on how to fix this?

4 Answers

Answered By CmdLineMaster23 On

I've seen discussions about issues arising from the latest version. You might want to uninstall all the Graph modules and then reinstall version 2.25.0 specifically with:

Install-Module -Name Microsoft.Graph -RequiredVersion 2.25.0

TechExplorer88 -

Hm, ok let me try that, thanks!

Answered By ScriptSleuth On

Can you share your script? It’s tough to troubleshoot without seeing what you’re working with.

TechExplorer88 -

Here's the weird part. No actual script.

Just

connect-mggraph

and then
get-mguser -userID

and then I get that error popup.

Answered By ModuleMaven On

It's possible you have multiple versions of the Graph module installed. Check that 'connect-MgGraph' is pulling from the correct version. You can use 'Invoke-MgGraphRequest' which should get pulled from the same loaded module as 'connect-mggraph', so it should work for commands afterward.

Answered By AccessMaster On

Have you tried connecting with specific scopes? You can add something like 'Connect-MgGraph -Scopes “User.Read.All”' to see if that helps.

TechExplorer88 -

Tried Connect-MgGraph -Scopes "Directory.ReadWrite.All", "DeviceManagementManagedDevices.ReadWrite.All", "DeviceManagementConfiguration.ReadWrite.All" -NoWelcome and connected successfully, but still no luck with other commands :/

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.