Troubleshooting Data Collection Issues in SharePoint Service, Web Applications, Databases and Timer Jobs (MS Office SharePoint monitor - PowerShell Mode)

Troubleshooting Data Collection Issues in SharePoint Service, Web Applications, Databases and Timer Jobs (MS Office SharePoint monitor - PowerShell Mode)

In MS Office SharePoint monitoring, data for SharePoint Services, Web Applications, Databases, and Timer Jobs is collected using PowerShell. If these metrics are missing, follow the steps below to identify and resolve the issue:

1. Verify the Prerequisites

  1. Ensure that all the prerequisites from the Prerequisites page are fulfilled.
  2. Login to the target SharePoint Server using the same user credentials configured in Applications Manager.
  3. Open SharePoint Management Shell and run the following commands to verify data retrieval:
    1. Get-SPServiceInstance
    2. Get-SPWebApplication
    3. Get-SPContentDatabase
    4. Get-SPTimerJob
  4. Confirm that the SharePoint Server-related services are running on the target server.

2. Performance Polling

  1. In Applications Manager, go to Settings → Performance polling → Optimize Data Collection.  
  2. Choose the Monitor Type as MS Office SharePoint.
  3. From the Metric Name dropdown, select SharePoint Service / Web Applications / Databases / Timer Jobs.
  4. Ensure that the Default Polling Status is updated as required to collect the data.
  5. When troubleshooting data collection issues, make sure it is set to Collect data during every poll for each of the above metrics.

3. Execute Applications Manager's PowerShell Script

  1. Open PowerShell in Administrator mode on the Applications Manager server.
  2. Navigate to the <AppManager-Home>\working\conf\application\scripts\powershell directory.
  3. Execute the following command (replace hostname, username, and password with the credentials of the SharePoint server as used in Applications Manager). 
  4. Use CredSSP option if chosen in the monitor.
Quote
.\SPMaster.ps1 'hostname' 'username' 'password' 'WebApplication,TimerJobs,ContentDB,SharepointServices' 'CredSSP'
  1. Check if the command returns a valid output.
Notes
Note:
  1. If you encounter errors related to New-PSSession or the WinRM service, recheck the Powershell prerequisites.
  2. Use the CredSSP option when:
    1. The monitored SharePoint Server is part of a SharePoint Farm, and/or 
    2. The monitored SharePoint Server belongs to a different domain than the Applications Manager server.
  3. Refer to the CredSSP prerequisites for configuration details. 

4. Run Direct Commands from the Applications Manager Server

  1. Open PowerShell in Administrator mode on the machine where Applications Manager is installed.
  2. Execute the following commands one by one, replacing <hostname> with the SharePoint Server hostname/IP-address in the first command alone. When prompted, enter the Username and Password (use the same values configured in the SharePoint Server monitor).
Quote
$Hostname = '<hostname>'

If CredSSP is not enabled,

$session= New-PSSession -ComputerName $Hostname -Credential Get-Credential

If CredSSP is enabled,

$session= New-PSSession -ComputerName $Hostname -Authentication Credssp -Credential Get-Credential

Invoke-Command -Session $session -ScriptBlock{ Add-PsSnapin Microsoft.SharePoint.Powershell -EA 0 }

$version=Invoke-Command -Session $session -ScriptBlock{(Get-PSSnapin microsoft.sharepoint.powershell).Version.Major}

$version

Invoke-Command -Session $session -ScriptBlock{ Get-SPServiceInstance }
Invoke-Command -Session $session -ScriptBlock{ Get-SPWebApplication }
Invoke-Command -Session $session -ScriptBlock{ Get-SPContentDatabase }
Invoke-Command -Session $session -ScriptBlock{ Get-SPTimerJob }
  1. Verify that the above commands are executed successfully and return the expected output.
Notes
Note:
  1. The above commands are native PowerShell cmdlets provided by Microsoft. If they fail to run, Applications Manager will not be able to collect the data either.
  2. Contact your Server team or Microsoft support for assistance if you continue to face issues.

5. Run Direct Commands on the SharePoint Server

  1. Log in to the SharePoint Server that is being monitored.
  2. Open the SharePoint Management Shell (run as Administrator).
  3. Execute the following commands to verify if data is retrieved successfully:
Quote
Get-SPServiceInstance
Get-SPWebApplication
Get-SPContentDatabase
Get-SPTimerJob
Following are the commands used in the Applications Manager's PowerShell script to fetch the corresponding data:
  1. SharePoint Service
Quote
Invoke-Command -Session $session -ScriptBlock{Get-SPServiceInstance |Where-Object{$_.Status -ne "Disabled"}| Select-Object TypeName,Status -ErrorAction 0 -WarningAction 0}| Select * -ExcludeProperty RunspaceID, PSComputerName,PSShowComputerName| ConvertTo-Csv -NoTypeInformation | select -Skip 1
  1. Databases
Quote
Invoke-Command -Session $session -ScriptBlock{Get-SPContentDatabase | Select-Object Name, Server, @{N="DiskSizeRequired";E={$_.DiskSizeRequired/1GB}}, WebApplication, CurrentSiteCount,Status -ErrorAction 0 -WarningAction 0}| Select * -ExcludeProperty RunspaceID, PSComputerName,PSShowComputerName  | ConvertTo-Csv -NoTypeInformation | select -Skip 1
  1. Web Applications - The data received from the below command is formatted to a tabular format
Quote
Invoke-Command -Session $session -ScriptBlock{ Get-SPWebApplication }
  1. Timer Jobs - The data received from the below command is processed to get the list of Failed Timer Jobs and the count of the Successful and Failed Jobs
Quote
Invoke-Command -Session $session -ScriptBlock{ Get-SPTimerJob }

                  New to ADSelfService Plus?

                    • Related Articles

                    • Data Collection: Troubleshoot data collection issues in MS Office SharePoint monitor

                      Note: Before troubleshooting, ensure that you have met all the required prerequisites for the SharePoint Server monitor. Troubleshooting no data collected for some or all metrics in the SharePoint Server monitor If no data is collected for some or ...
                    • Error: No Data collected in MS Office SharePoint monitor added in Powershell mode

                      Error: "Unable to create remote PowerShell session" or "No data returned from PowerShell script" If you face any of the above errors or any other error related to PowerShell Session, follow the below steps to check if you are able to run individual ...
                    • MS Office SharePoint Monitor - FAQ

                      1. What are the ports used in SharePoint Server monitoring? WMI mode: Remote Procedure Call (RPC): Port 135 (default) Dynamic DCOM Ports: WMI uses DCOM for remote communication, which typically involves a random port number above 1024 for the server ...
                    • Real User Monitor (RUM) - Troubleshooting

                      If the monitor has not polled data for a long time, follow the below steps for troubleshooting. Step 1: Check the RUM Agent configuration Real User Monitor requires the RUM Agent to be installed and mapped to the Applications Manager. Refer this help ...
                    • 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 ...