Troubleshooting Mailbox and Database Statistics Data Collection
In an Exchange Server monitor added in PowerShell mode, if performance metrics are visible but Mailbox and Database Statistics data is not collected, the issue might be that the normal PowerShell session is working fine, but the Exchange PS Session is not established. Follow the steps below to troubleshoot this.
1. Prerequisites:
- Ensure all the prerequisites from the Prerequisites page are complete.
- Login to the respective Exchange Server and open the Exchange Management Shell using the same user credentials used for monitoring. Then, run the following commands to verify data retrieval:
- Get-MailboxDatabase
- Get-Mailbox
- Make sure that all the services related to the Exchange Server are running on the target server.
2. Execute Scripts Used in Applications Manager
- Open PowerShell in Administrator mode on the machine where Applications Manager is installed.
- Navigate to the <AppManager-Home>\working\conf\application\scripts\powershell directory.
Execute the appropriate command by replacing hostname, username, and password with the credentials of the Exchange server used in Applications Manager:
- For Database Statistics:
.\E201X_MBX_Tables.ps1 'hostname' 'username' 'password' - For Top and Inactive Mailboxes:
Applications Manager version 172900 and above:
.\EX_Mailbox_Statistics.ps1 'hostname' 'username' 'password'
Applications Manager version below 172900:
.\EX_Mailboxes.ps1 'hostname' 'username' 'password' 'TopMailboxes,InactiveMailboxes' - Check if you get the expected output. If you are able to get the output for the script but unable to see the data in Applications Manager, refer to this FAQ-2
- If you encounter an error related to New-PSSession, or the WinRM service, recheck the Powershell prerequisites and try to resolve the same.
- The script uses Kerberos Authentication to create the Exchange PS Session. If it fails, it falls back to Basic Authentication.
- If error occurred while creating session, both the authentications have failed.
If still error occurs, check if Basic Authentication is enabled for WinRM Client in the Applications Manager installed server. Open the Local Group Policy Editor and navigate to Local Computer Policy -> Computer Configuration -> Administrative Template -> Windows Components -> Windows Remote Management (WinRM) -> WinRM Client -> Allow Basic authentication -> Set it as Enabled and then try again.
3. Run Direct Commands from Applications Manager Server
- Open PowerShell in Administrator mode on the machine where Applications Manager is installed.
- Run the following commands one by one, replacing <hostname> with the Exchange Server hostname/IP-address in the first command alone. Run the remaining commands as mentioned below. Enter the Username and Password when prompted (use the same values as used in the Exchange Server monitor).
$Hostname = '<hostname>'
$ServerName = [System.Net.Dns]::gethostentry($Hostname).HostName
$ServerName
$so = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
$exsession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://$ServerName/powershell" -AllowRedirection -Authentication Kerberos -Credential Get-Credential -SessionOption $so
(Attempt Kerberos authentication, if failed try below command for Basic Authentication)
$exsession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://$ServerName/powershell" -Authentication Basic -Credential Get-Credential -SessionOption $so
(If Basic Authentication fails, ensure above mentioned prerequisites are completed)
Import-PSSession $exsession -AllowClobber -DisableNameChecking | out-null
Get-MailboxDatabase
Get-Mailbox
- Verify that the above commands execute without any errors.
- Contact your Server team or Microsoft support for assistance if you continue to face issues as these are standard commands for Exchange Server.
4. Run Direct Commands on the Exchange Server
- Log in to the respective Exchange Server that is being monitored.
- Open the Exchange Management Shell.
- Run the following commands (replace <hostname> with the same hostname/IP-address used in the Exchange Server monitor):
$Hostname = '<hostname>'
$ServerName = [System.Net.Dns]::gethostentry($Hostname).HostName
$ServerName
$ServerHostname = $ServerName.split(".")[0]
- Run the relevant commands listed below to fetch specific metrics.
Commands used in the script to fetch specific metrics
- Database Statistics:
Get-MailboxDatabase -Server $ServerHostname -Status | Select-Object MasterType, MasterServerOrAvailabilityGroup, Name, Mounted,@{Name="MailboxCount";Expression={(Get-Mailbox -Database $_.name -ResultSize Unlimited).Count}},@{name="databasesize"; expression={[math]::Round(($_.databasesize.ToString().Split("(")[1].Split(" ")[0].Replace(",","")/1GB),2)}},@{name="availablenewmailboxspace"; expression={[math]::Round(($_.availablenewmailboxspace.ToString().Split("(")[1].Split(" ")[0].Replace(",","")/1GB),2)}}, LastFullBackup, @{name="age"; expression={(New-TimeSpan -Start $_.LastFullBackup -End $currentdate).Days}}, CircularLoggingEnabled | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | select -skip 1
- Database Availability Groups:
Get-DatabaseAvailabilityGroup
- Database Copy Statistics:
Get-MailboxDatabase -Server $ServerHostname -Status | Get-MailboxDatabaseCopyStatus | Select-Object name, Status, CopyQueueLength, ContentIndexState, LatestFullBackupTime, @{name="age"; expression={(New-TimeSpan -Start $_.LatestFullBackupTime -End $currentdate).Days}}, ActiveCopy | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | % {$_.Replace('\','- ')} |select -skip 1
- Top Mailboxes:
Get-Mailbox -Server $ServerHostname -ResultSize Unlimited -wa SilentlyContinue | Get-MailboxStatistics -wa SilentlyContinue | Sort-Object TotalItemSize -Descending | Select-Object -First 10 | Select-Object DisplayName,@{name="TotalItemSizeMB"; expression={[math]::Round(($_.TotalItemSize.ToString().Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | select -skip 1
- Inactive Mailboxes:
Get-Mailbox -Server $ServerHostname -ResultSize Unlimited -WarningAction SilentlyContinue |where {(!$_.name.startswith("SystemMailbox")) -and (!$_.name.startswith("FederatedEmail")) -and (!$_.name.startswith("DiscoverySearchMailbox"))}| Get-MailboxStatistics -WarningAction SilentlyContinue | Select-Object DisplayName,LastLogonTime, @{name="DaysSinceLogin"; expression={((Get-Date) - $_.LastLogonTime).Days}} | where DaysSinceLogin -gt 30 | Sort-Object DaysSinceLogin -Descending | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | select -skip 1
- Exchange Queues:
Get-Queue | Select-Object Identity,DeliveryType,Status,MessageCount,Velocity,NextHopDomain | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | % {$_.Replace('\','\\')} | select -skip 1
New to ADSelfService Plus?
Related Articles
Data Collection: Troubleshoot data collection issues in Exchange Server monitor
Prerequisites: Ensure that you have met all the prerequisites for the Exchange Server monitor. Refer to the below error scenarios and refer to the respective troubleshooting steps. No data collected for few metrics or all the metrics in Exchange ...
Troubleshooting no data issues for NTP Statistics
This article helps troubleshoot scenarios where NTP statistics metrics display "No Data Available" message for Windows and Linux monitors in Applications Manager. Follow the steps below to validate NTP configuration, verify permissions, and diagnose ...
Real User Monitor (RUM) - Troubleshooting guide
If your Real User Monitor has not collected data for an extended period, follow the steps below to troubleshoot the issue. Step 1: Verify the RUM Agent configuration Real User Monitoring requires the RUM Agent to be installed and mapped to ...
APM Insight monitor is UP, but monitor page doesn't show any data
Possible Causes The APM Insight monitor status corresponds to the respective agent folder pointed Java Application status i.e., as long as the Application server is running, the monitor status will be UP. 1. No Transactions Recorded: It is possible ...
Troubleshooting Checklist: No data in Reports for Performance Metrics
Troubleshooting checklist: No data in Reports for Performance Metrics Overview Use this checklist when there is no data displayed in the Performance Metrics Reports (Attribute Report, Attribute History Report and Advanced Reports), or when an ...