Troubleshooting errors in SharePoint Online (PowerShell mode)
Ensure that you have met all the prerequisites for the Microsoft 365 monitor. From Applications Manager version 16300 onwards, Microsoft 365 monitor will use Microsoft Graph API as the primary mode of data collection. We have migrated from PowerShell to Graph API as Microsoft 365 PowerShell commands were taking more time to execute for huge resources and needed Administrative user privileges to execute the commands. Microsoft provides only archived data in the Graph API. To monitor live data, use the PowerShell mode considering the user privileges and the time taken to fetch huge resources.
For REST API related common errors
in Applications Manager from version 16310
, refer this KB
How to fix "Connecting to Sharepoint Online failed." error?
Please do the following on the Applications Manager installed machine and send us the output to troubleshoot further:
- Ensure the given Tenant name is correct.
- Usually, the tenant name can be found before .onmicrosoft.com. For example, the tenant name for firstname.lastname@example.org would be apm.
- Open Powershell -> Run as Administrator
- Navigate to "Appmanager_home\working\conf\application\scripts\powershell" directory.
Execute the below:
.\Office365CheckConnectivity.ps1 'tenant-name' 'office365-useremail' 'office365password' 'Office365,ExchangeOnline,SharepointOnline,MicrosoftTeams'
- If you encounter the above error when running the Office365CheckConnectivity.ps1 or SharepointOnlineMetrics.ps1 script then it might be because Modern Authentication has been enabled in the SP Online tenant.
- Currently, the Applications Manager makes use of Basic Authentication. However, if the LegacyAuthProtocolsEnabled key is set to True in your SP online tenant, the Applications Manager can connect using non-modern authentication. Follow the steps given below to check if the LegacyAuthProtocolsEnabled key has been enabled and to set it as True.
- Open Powershell using administrator privileges in the AppManager installed machine and run the below command.
- Now run the below command by replacing <tenant> with the tenant name and enter the user email and password when prompted.
Connect-SPOService -Url https://<tenant>-admin.sharepoint.com
- Once the service has been connected, run the below command.
- Check the output received. Verify the value for the LegacyAuthProtocolsEnabled key.
- If it is not True, run the below command to set the value as True.
Set-SPOTenant -LegacyAuthProtocolsEnabled $True
- Now try running the same script and check if you get the Connection successful message.
: For more details, search for LegacyAuthProtocolsEnabled in this link
If the same issue persists, contact Microsoft Support mentioning that the error occurs while trying to connect to SharePoint Online by using stored credentials.
How to fix "Could not load type Microsoft.SharePoint.Client" error?
If you encounter this error received, then it might be because of DLL version mismatch in the SharePoint Online PowerShell modules installed. To resolve this issue, try the below steps:
- Go to Control Panel -> Programs and Features and uninstall SharePoint Online Management Shell and SharePoint Online Client SDK if installed.
- Delete SharePoint Online Client Assemblies from C:\Windows\Microsoft.NET\assembly\GAC_MSIL directory. Remove all the folders starting with the name Microsoft.SharePoint*
Now open admin PowerShell and run the below commands one by one:
Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
- Once installation is successful, try executing the script in the above-mentioned link and check if you get the Connection successful message.
If the issue persists, contact Microsoft Support mentioning that the error occurs while trying to Import the SharePoint Online Powershell module.
How to fix "Error : Service health retrieval failed" error?
, to troubleshoot service health issues.
New to ADSelfService Plus?