Microsoft Graph PowerShell Modules Not Responding โ Is Anyone Else Facing This Issue?
Asked by
TechWhiz92
I'm encountering a frustrating problem with Microsoft Graph PowerShell modules. They were working fine for me for years, but recently, all cmdlets are timing out with an error. This happens on both PowerShell 5.1 and 7. The only commands that work are connect-mggraph and get-mgcontext, which show that my session is active and I have the correct scopes. However, any other commandโlike get-mguser, get-mgserviceprincipal, get-mgusermemberof, or get-mggroupโresults in a timeout error saying, "The request was canceled due to the configured HttpClient.Timeout of 300 seconds elapsing." I've tried uninstalling and reinstalling the modules and even rolled back to an earlier version, but nothing has resolved the issue. All my organization's admins are facing this problem too. I've checked everything on the admin side, including Enterprise Applications and Application Registration, and everything seems fineโno expired certificates, and the app is still authorized. I even confirmed that a test connection to graph.microsoft.com on port 443 is successful. I've submitted a support ticket to Microsoft but haven't gotten a response. Has anyone else experienced this?
Answers
I went through a similar struggle. I tried basically everything: deleting modules, disconnecting, clearing browser auth, reinstalling PowerShell 7, and even messing around with different scopes. Even direct API calls were timing out. Have you tried any of these steps?
Reply to this answer
Honestly, this seems to break randomly. The last time it happened to me, I found out I had too many versions of the graph modules installed. Cleaning them up did the trick for me.
Reply to this answer
It sounds like you're not alone! I've had to adapt my scripts to use REST API calls for the authentication token with connect-mggraph. It's like an endless game of M365 PowerShell twist and turns. If only it made life easier without needing to be a full-time PowerShell developer!
Reply to this answer
Thanks for updating us with your solution! I tried specifying the -ContextScope Process parameter for connect-mggraph today, and it actually worked for me too. What a relief!
Reply to this answer
Add your answer
Answers are reviewed before publication.
DevExplorer99: That's exactly what I did too, switching to REST API calls and all that jazz. Itโs a lot of work compared to just using the Graph PowerShell SDK, but sometimes you just have to roll with the punches.