Hey everyone, I'm running into some issues while trying to use PowerShell cmdlets with Microsoft Graph. I can successfully connect using the Connect-MgGraph cmdlet and see the welcome message without any errors. However, when I try to execute commands like Get-MgUser or Get-MgUserMemberOf, I'm getting aggregate exceptions that cause my script to crash. The full error message I'm seeing is: System.AggregateException,Microsoft.Graph.Powershell.Cmdlets.GetMgUserMemberOf_List. This script was working perfectly fine just a few days ago, and nothing has changed on my end. I've checked that the necessary modules are installed and my Entra roles seem to be correct. Is anyone else experiencing issues with Graph PowerShell today?
1 Answer
You should try running your cmdlet with the -debug flag. It can give you more insight into what's going wrong with the execution by providing detailed error logs. Sometimes, the debugging info can help pinpoint the issue directly.
I did that, and it seems like the error message has changed a bit! Now I'm getting an AuthenticationException, which says I need to call Connect-MgGraph again. So, it's not just the script that's affected, it's happening even with basic commands. This seems like an issue with the service itself.