References > Template Reference > Exchange 2007 - 2013 > Exchange 2007-2010 Statistics with PowerShell

Exchange 2007-2010 Statistics with PowerShell

This template tracks the statistics of Exchange mailboxes and the mailbox databases of Exchange 2007-2010 servers with the Mailbox role using PowerShell scripts.

Prerequisites

  • PowerShell 2.0 and Exchange Management Tools 2007 or 2010 installed on the SAM server.
  • The Exchange server must have an Exchange Mailbox role.
  • The SAM server and the Exchange server must be in the same domain.

Credentials

The credentials must be that of an Exchange Administrator (Organization Manager) account with at least view-only permissions.

Monitored Components:

For details on monitors, see SAM Component Monitor Types.

These component monitors are based on the following information:

Exchange 2007: Database Statistics in PowerShell:
http://exchangeshare.wordpress.com/2009/07/27/exchange-2007-database-statistics-in-powershell/

Getting Mailbox Statistics in Exchange 2007:
http://www.msexchange.org/articles_tutorials/exchange-server-2007/management-administration/getting-mailbox-statistics-exchange-2007.html.

Before using this template, under the Advanced tree collapse [+], you should set the correct platform; either 32 bit or 64 bit, from the drop down menu. The default it set to 32 bit.

Total mail size (MB)

This component monitor returns the total mail size on the server in MB.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;

Example:

xchng2010.domain.com,2010,dc.domain.com

To see the names of your Exchange servers, run the following command in the Exchange Management Shell: Get-ExchangeServer

Total mailboxes

This component monitor returns the total number of mailboxes on the server.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;

Example:

xchng2010.domain.com,2010,dc.domain.com

To see the names of your Exchange servers, run the following command in the Exchange Management Shell: Get-ExchangeServer

Total items in mailboxes

This component monitor returns the total number of emails on the server.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;

Example:

xchng2010.domain.com,2010,dc.domain.com

To see the names of your Exchange servers, run the following command in the Exchange Management Shell: Get-ExchangeServer

Total size of specified database file (MB)

This component monitor returns the total size of all mailboxes in the specified database in MB.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name,mailbox_database

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;
  • mailbox_database – target mailbox database name;

Example:

xchng2010.domain.com,2010,dc.domain.com,Mailbox Database

To see the names of your mailbox databases, run the following command in the Exchange Management Shell: Get-MailboxDatabase

Total mailboxes in specified database file

This component monitor returns the number of mailboxes in the specified database.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name,mailbox_database

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;
  • mailbox_database – target mailbox database name;

Example:

xchng2010.domain.com,2010,dc.domain.com,Mailbox Database

To see the names of your mailbox databases, run the following command in the Exchange Management Shell: Get-MailboxDatabase

Items in mailbox of specified user

This component monitor returns the number of emails for the specified user.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name,username

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;
  • username – target username;

Example:

xchng2010.domain.com,2010,dc.domain.com,john

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

Mailbox size of specified user (MB)

This component monitor returns the mailbox size for the specified user in MB.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name,username

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;
  • username – target username;

Example:

xchng2010.domain.com,2010,dc.domain.com,john

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

Average items per mailbox

This component monitor returns the average number of emails per mailbox based on a mathematical count.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;

Example:

xchng2010.domain.com,2010,dc.domain.com

To see the names of your Exchange servers, run the following command in the Exchange Management Shell: Get-ExchangeServer

Size of largest user mailbox (MB)

This component monitor returns the size of the largest mailbox. You can see the user name for the assigned mailbox in the message field.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;

Example:

xchng2010.domain.com,2010,dc.domain.com

To see the names of your Exchange servers, run the following command in the Exchange Management Shell: Get-ExchangeServer

Dismounted mailbox databases

This component monitor returns the number of dismounted mailbox databases. The last mailbox database to be dismounted is displayed in the message field.

The name of the last dismounted database is taken from the list of databases and is not based on the actual time the database was dismounted. There is no database attribute that records the time it was dismounted.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;

Example:

xchng2010.domain.com,2010,dc.domain.com

To see the names of your Exchange servers, run the following command in the Exchange Management Shell: Get-ExchangeServer

Mounted mailbox databases

This component monitor returns the number of mounted mailbox databases.

You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. If you fail to do this, the counter will return with an error of "Undefined" status. Put arguments in the following order:

Exchange_server_name,exchange_version,domain_controller_name

where:

  • Exchange_server_name – hostname or FQDN of target Exchange server;
  • exchange_version – version of target Exchange server (2007 or 2010);
  • domain_controller_name – hostname or FQDN of domain controller;

Example:

xchng2010.domain.com,2010,dc.domain.com

To see the names of your Exchange servers, run the following command in the Exchange Management Shell: Get-ExchangeServer