How to fix the error: ‘One or more errors occurred’ in Microsoft Graph PowerShell 

How to fix the error: ‘One or more errors occurred’ in Microsoft Graph PowerShell

When upgrading existing MSOnline PowerShell scripts to MS Graph PowerShell, I encountered the ‘One or more errors occurred‘ error. While searching the internet, I noticed similar discussions on multiple technical forums. However, I couldn’t find an exact solution for the error. After some trials, I discovered the cause of the error and a solution. As a result, I decided to document it to help others.

One or More Errors Occurred – Why Does it Happen?

One or more errors occurred in MS Graph

This error typically occurs when you have multiple versions of the MS Graph PowerShell module installed. To identify the available versions of the MS Graph PowerShell module, run the following cmdlet:

Get-Module -Name Microsoft.Graph -ListAvailable 

This cmdlet will list the Microsoft Graph PowerShell modules installed on your system. If it lists multiple versions of MS Graph, you can proceed to uninstall the older versions.

How to Resolve the Error?

To uninstall the Microsoft Graph PowerShell, follow the below procedure:

Identify the version of MS Graph that needs to be uninstalled and replace <Version_To_Be_Uninstalled> with the specific version you want to remove in the following script:

$Version=<Version_To_Be_Uninstalled> #Provide the value in quotes 
Uninstall-Module -Name "Microsoft.Graph" -RequiredVersion $Version -Force 

After uninstalling all the older versions, you can verify that only the latest module is available on your system by running the Get-Module cmdlet.

Uninstall MS Graph PowerShell

Now, when you run any MS Graph cmdlets, you should no longer encounter the ‘One or more errors occurred‘ error, allowing you to effectively manage your Microsoft 365 environment with MS Graph.

I hope this blog will help you resolve the MS Graph PowerShell error. If you need further assistance, you can reach out to us through the comment section.

Related: Select-MgProfile is not recognized in MS Graph PowerShell.

How to fix the error: ‘One or more errors occurred’ in Microsoft Graph PowerShell 

by Kavya time to read: 1 min
0