Troubleshooting errors in SharePoint Online (PowerShell mode)

Troubleshooting errors in SharePoint Online (PowerShell mode)

Prerequisites: 

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:
  1. Ensure the given Tenant name is correct.
    1. Usually, the tenant name can be found before .onmicrosoft.com. For example, the tenant name for username@apm.onmicrosoft.com would be apm.
  2. Open Powershell -> Run as Administrator
  3. Navigate to "Appmanager_home\working\conf\application\scripts\powershell" directory.
  4. Execute the below:
    .\Office365CheckConnectivity.ps1 'tenant-name' 'office365-useremail' 'office365password' 'Office365,ExchangeOnline,SharepointOnline,MicrosoftTeams'

How to fix "Cannot contact web site 'https://<tenantname>-admin.sharepoint.com/' or the website does not support SharePoint Online credentials. The response status code is 'Unauthorized'. " errors?

  1. 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.
  2. 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.
    1. Open Powershell using administrator privileges in the AppManager installed machine and run the below command.
      1. Import-Module Microsoft.Online.Sharepoint.PowerShell
    2. Now run the below command by replacing <tenant> with the tenant name and enter the user email and password when prompted.
      1. Connect-SPOService -Url https://<tenant>-admin.sharepoint.com
    3. Once the service has been connected, run the below command.
      1. Get-SPOTenant
    4. Check the output received. Verify the value for the LegacyAuthProtocolsEnabled key.
    5. If it is not True, run the below command to set the value as True.
      1. Set-SPOTenant -LegacyAuthProtocolsEnabled $True
    6. Now try running the same script and check if you get the Connection successful message.
Ref: 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:
  1. Go to Control Panel -> Programs and Features and uninstall SharePoint Online Management Shell and SharePoint Online Client SDK if installed.
  2. Delete SharePoint Online Client Assemblies from C:\Windows\Microsoft.NET\assembly\GAC_MSIL directory. Remove all the folders starting with the name Microsoft.SharePoint*
  3. 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
  4. 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?

Refer here, to troubleshoot service health issues.
Reach out to our support team with the text file containing the output and email the same to appmanager-support@manageengine.com along with the latest Support Information File (SIF) from Applications Manager with print all logs enabled for analysis.





                New to ADManager Plus?

                  New to ADSelfService Plus?