Exchange 2010-2013 Mailbox Send and Receive Statistics with PowerShell

This template tracks Exchange Mailbox Send/Receive statistics of the Exchange 2010 or 2013 server with the Mailbox role using PowerShell scripts.


Prerequisites:

  • Exchange Management Tools must be installed on the target Exchange server.
  • Windows Authentication should be enabled for PowerShell on the Exchange server. This can be configured in IIS mmc.
    Start > Administrative Tools > Internet Information Services (IIS) Manager.
  1. In the IIS console, expand Your Server, Sites, Default Web Site. Select PowerShell application. On the central panel, open Authentication:
  2. Select Windows Authentication and Enable it from the right panel:


Credentials:
The credentials must be that of an Exchange Administrator account (Organization Manager) with at least view-only permissions. Credentials should be provided with the domain part in the login field. For example – domain\user.


Note:
If you have trouble with template functionality, refer to the troubleshooting section at the end of this document.


Monitored Components

Note: You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitors. If you fail to do this, the counter will return with an error of "Undefined" status. All monitors require the following argument:


user@some.domain

where:
user@some.domain – the user you want to monitor;

For example:

pi@apm.com

To see the names of the users, run the following command in Exchange Management Shell: Get-Mailbox

Number of items received by specific user (total)

This component monitor returns the total number of items received by the specified user.

Number of items sent by specific user (total)

This component monitor returns the total number of items sent by the specified user.

Number of items received by specific user during last hour

This component monitor returns the number of items received by the specified user during the last hour.

Number of items sent by specific user during last hour

This component monitor returns the number of items sent by the specified user during the last hour.

Number of items received by specific user during last day

This component monitor returns the number of items received by the specified user during the last day.

Number of items sent by specific user during last day

This component monitor returns the number of items sent by the specified user during the last day.

Number of items received by specific user during last month

This component monitor returns the number of items received by the specified user during the last month.

Number of items sent by specific user during last month

This component monitor returns the number of items sent by the specified user during the last month.

Number of items received by specific user during last polling period

This component monitor returns the number of items received by the specified user during the last polling period.

Number of items sent by specific user during last polling period

This component monitor returns the number of items sent by the specified user during the last polling period.


Troubleshooting

If you have a returned error similar to the following:

Message: ERROR: Please check target server argument and credentials (should be domain\user). [192.168.1.206] Connecting to remote server failed with the following error message : Access is denied.

Resolution: This error could occur when you use the wrong credentials. Check the credentials and verify the credentials are in the following format: (domain\user). The user should be Exchange Organization Manager.


If you have a returned error similar to the following:

ERROR: The operation couldn't be performed because object 'Mailbox Database 10580933221\*' couldn't be found on 'xchng2010.apmteam.sw'.

Resolution: Provide the correct database name.


If you have a returned error similar to the following:

[192.168.1.206] Connecting to remote server failed with the following error message : The WinRM client cannot process the request. The WinRM client tried to use Negotiate authentication mechanism, but the destination computer (192.168.1.206:443) returned an 'access denied' error. Change the configuration to allow Negotiate authentication mechanism to be used or specify one of the authentication mechanisms supported by the server. To use Kerberos, specify the local computer name as the remote destination. Also verify that the client computer and the destination computer are joined to a domain. To use Basic, specify the local computer name as the remote destination, specify Basic authentication and provide user name and password.

Resolution: This error indicates that Windows Authentication is not enabled for the PowerShell application on IIS on the Exchange server.


If you have a returned error similar to the following:

[192.168.1.206] Connecting to remote server failed with the following error message : The WinRM client received an HTTP status code of 403 from the remote WS-Management service.

Resolution: If you get this error, you should check your SSL settings for the PowerShell application in IIS on the Exchange server.

You should use one of the following configurations:

- Require SSL unchecked;
- Require SSL checked and Client Certificates is set to Accept;
- Require SSL checked and Client Certificates is set to Ignore;


If you have a returned error similar to the following:

Message: ERROR: Please check target server argument and credentials (should be domain\user). [xchng2010] Connecting to remote server failed with the following error message : The WS-Management service cannot process the request. This user allowed a maximum number of 5 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user.

Resolution: This error could occur when you use more than five remote PowerShell sessions (set by default) at the same time. If you get this error, it is recommended that you increase the number of concurrent shells on the Exchange server. Open a windows Command Line as Administrator and run the following command:
winrm set winrm/config/winrs @{MaxShellsPerUser="30"}


Portions of this document are provided courtesy of the following sources: