Troubleshooting errors in Exchange Online (PowerShell Mode)

Troubleshooting errors in Exchange 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 the Applications Manager from version 16310, refer this KB.

How to fix "Connecting to Exchange Online failed" error?

Open Powershell in the administrator mode:
  • Navigate to Appmanager_home\working\conf\application\scripts\powershell directory.

  • Execute the below command:

.\Office365CheckConnectivity.ps1 'tenant-name' 'office365-useremail' 'office365password' 'Office365,ExchangeOnline' > Office365Troubleshoot.txt
      where you have to replace tenant-name, office365-useremail, office365password with values used when adding the monitor.

  • Send us the Office365Troubleshoot.txt file generated. You can find it in the same directory.


If the output of the above commands contains the below error information, follow the steps given to allow basic authentication.
<--ErrorStarts--> Connecting to Exchange Online failed :: Connecting to remote server ps.outlook.com failed with the following error message : The WinRM client annot process the request. Basic authentication is currently disabled in the client configuration. Change the client configuration and try the request again. For more information, see the about_Remote_Troubleshooting Help topic.<--ErrorEnds-->

1) Open cmd prompt.
2) Run the below command to view the Client configuration.
  winrm get winrm/config/client 
3)Run the below cmd to set Basic Authentication to true:
  winrm set winrm/config/client/auth @{Basic="true"} 
If the policy is controlled by GPO or AD, accordingly check and enable Basic Authentication in order to connect to Exchange Online.
To know more about why you need to enable Basic authentication,  refer this link.

How to fix "Error: Exchange Online Management PowerShell module is not installed" error?

This error occurs when the Exchange Online PowerShell V2 Module is not installed in the AppManager server. From Applications Manager version 16080 we have made the use of Exchange Online PowerShell V2 Module as the default mode for data collection for Exchange Online monitor as the previously used commands are deprecated by Microsoft.
  1. Open Powershell in administrator mode and run the below command in AppManager installed server and check if the ExchangeOnlineManagement module is listed.
Get-Module -ListAvailable
  1. If the module is not present, install the module from the below link.
    https://www.powershellgallery.com/packages/ExchangeOnlineManagement/2.0.5
  2. Once installed, run the below commands and check if you are able to connect to Exchange Online without any errors and if you are able to see the output.
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -ShowBanner:$false
Get-EXOMailbox
  1. If you encountered this error while adding the monitor for the first time, try to add the monitor now if the above commands run without any error.
  2. For existing monitors, try polling the monitor and check if the error has been rectified and if data is being collected.


  1. If the error persists, Open Powershell in administrator mode, navigate to <Applications Manager home>\working\conf\application\scripts\powershell directory and run the below command by replacing tenant-nameuser-email and password with that used while adding the Microsoft 365 monitor.
.\ExchangeOnlineMetrics.ps1 'tenant-name' 'user-email' 'password' 'TopMailboxes,InactiveMailboxes'
  1. Check the output received and copy it to a text file.

How to fix "Error : Timeout exceeded during script execution. Data collection failed for Mailbox Statistics. Try increasing the poll interval and timeout." error?

Perform the following steps on the Applications Manager installed machine and send us the output to troubleshoot further:
  1. Open Powershell as administrator by right-clicking and selecting the 'Run as administrator' option.
  2. Navigate to <Applications Manager Home>\working\conf\application\scripts\powershell directory.
  3. Execute the command for the respective monitor type.
  4. Copy the full output to a text file and send the file to us.
To find the script execution time: 
To analyze the time taken for the above scripts, execute the above scripts as mentioned below once again, and share screenshots of time taken in addition to script output from the above scripts:
Measure-Command {<Command>}
  1. Based on the time taken, increase the Polling interval and Timeout values for the particular monitor. When the polling interval is increased, the health and availability will be checked only at that particular time interval.
  2. For Exchange Online monitor if huge data is found and takes a very long time, set the timeout value accordingly, and set custom polling interval by following the below steps:
    1. Go to Admin -> Performance Polling -> Optimize data collection
    2. Choose Monitor Type as Exchange Online.
    3. For both Top Mailboxes By Size and Inactive Mailbox Users metrics, choose Collect data at customized time interval option.
    4. Set the value as 24 Hrs to fetch this data once in a day and click Save.
If the issue still persists share the above outputs, screenshots of the above-mentioned page, monitor information page, edit monitor page, and the latest SIF for analysis.

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?