Applies to: Exchange Server 2010 SP3, Exchange Server 2010 SP2

Topic Last Modified: 2012-11-16

Use the Get-MailboxStatistics cmdlet to obtain information about a mailbox, such as the size of the mailbox, the number of messages it contains, and the last time it was accessed. In addition, you can get the move history or a move report of a completed move request.

Syntax

Get-MailboxStatistics -Identity <GeneralMailboxOrMailUserIdParameter> [-Archive <SwitchParameter>] [-DomainController <Fqdn>] [-IncludeMoveHistory <SwitchParameter>] [-IncludeMoveReport <SwitchParameter>]
Get-MailboxStatistics -Database <DatabaseIdParameter> [-DomainController <Fqdn>]
Get-MailboxStatistics -Server <ServerIdParameter> [-DomainController <Fqdn>]

Detailed Description

On Mailbox servers only, you can use the Get-MailboxStatistics cmdlet without parameters. In this case, the cmdlet returns the statistics for all mailboxes on all databases on the local server.

Note:
The Get-MailboxStatistics cmdlet requires at least one of the following parameters to complete successfully: Server, Database, or Identity.

You can use the Get-MailboxStatistics cmdlet to return detailed move history and a move report for completed move requests to troubleshoot a move request. To view the move history, you must pass this cmdlet as an object. Move histories are retained in the mailbox database and are numbered incrementally, and the last executed move request is always numbered 0. For more information, see "EXAMPLE 6," "EXAMPLE 7," and "EXAMPLE 8" later in this topic.

Note:
You can only see move reports and move history for completed move requests.

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Recipient Provisioning Permissions" section in the Mailbox Permissions topic.

Parameters

Parameter Required Type Description

Database

Required

Microsoft.Exchange.Configuration.Tasks.DatabaseIdParameter

The Database parameter specifies the name of the mailbox database. When you specify a value for the Database parameter, the Exchange Management Shell returns statistics for all the mailboxes on the database specified.

You can use the following values:

  • GUID

  • Database

This parameter accepts pipeline input from the Get-MailboxDatabase cmdlet.

Identity

Required

Microsoft.Exchange.Configuration.Tasks.GeneralMailboxOrMailUserIdParameter

The Identity parameter specifies a mailbox. When you specify a value for the Identity parameter, the command looks up the mailbox specified in the Identity parameter, connects to the server where the mailbox resides, and returns the statistics for the mailbox.

This parameter accepts the following values:

  • Alias

    Example: JPhillips

  • Canonical DN

    Example: Atlanta.Corp.Contoso.Com/Users/JPhillips

  • Display Name

    Example: Jeff Phillips

  • Distinguished Name (DN)

    Example: CN=JPhillips,CN=Users,DC=Atlanta,DC=Corp,DC=contoso,DC=com

  • Domain\Account

    Example: Atlanta\JPhillips

  • GUID

    Example: fb456636-fe7d-4d58-9d15-5af57d0354c2

  • Immutable ID

    Example: fb456636-fe7d-4d58-9d15-5af57d0354c2@contoso.com

  • Legacy Exchange DN

    Example: /o=Contoso/ou=AdministrativeGroup/cn=Recipients/cn=JPhillips

  • SMTP Address

    Example: Jeff.Phillips@contoso.com

  • User Principal Name

    Example: JPhillips@contoso.com

Server

Required

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

The Server parameter specifies the server from which you want to obtain mailbox statistics. You can use one of the following values:

  • Fully qualified domain name (FQDN)

  • NetBIOS name

When you specify a value for the Server parameter, the command returns statistics for all the mailboxes on all the databases, including recovery databases, on the specified server. If you don't specify this parameter, the command returns logon statistics for the local server.

Archive

Optional

System.Management.Automation.SwitchParameter

The Archive switch parameter specifies whether to return mailbox statistics for the archive mailbox associated with the specified mailbox.

You don't have to specify a value with this parameter.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that retrieves data from Active Directory.

IncludeMoveHistory

Optional

System.Management.Automation.SwitchParameter

The IncludeMoveHistory switch specifies whether to return additional information about the mailbox that includes the history of a completed move request, such as status, flags, target database, bad items, start times, end times, duration that the move request was in various stages, and failure codes.

IncludeMoveReport

Optional

System.Management.Automation.SwitchParameter

The IncludeMoveReport switch specifies whether to return a verbose detailed move report for a completed move request, such as server connections and move stages.

Note:
Because the output of this command is verbose, you should send the output to a .CSV file for easier analysis.

Input Types

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.

Return Types

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.

Examples

EXAMPLE 1

This example retrieves the mailbox statistics for a mailbox by using the alias AylaKol.

Copy Code
Get-MailboxStatistics -Identity AylaKol

EXAMPLE 2

This example retrieves the mailbox statistics for all mailboxes on the server MailboxServer01.

Copy Code
Get-MailboxStatistics -Server MailboxServer01

EXAMPLE 3

This example retrieves the mailbox statistics for the specified mailbox.

Copy Code
Get-MailboxStatistics -Identity contoso\chris

EXAMPLE 4

This example retrieves the mailbox statistics for all mailboxes in the specified mailbox database.

Copy Code
Get-MailboxStatistics -Database "Mailbox Database"

EXAMPLE 5

This example retrieves the mailbox statistics for all disconnected mailboxes. This example uses a WHERE clause. The $_ variable is used to specify the object passed on the pipeline. The -ne operator means not equal.

Copy Code
Get-MailboxStatistics | Where {$_.DisconnectDate -ne $null}

EXAMPLE 6

This example returns the summary move history for the completed move request for Ayla Kol's mailbox. If you don't pipeline the output to the Format-List cmdlet, the move history doesn't display.

Copy Code
Get-MailboxStatistics -Identity AylaKol -IncludeMoveHistory | Format-List

EXAMPLE 7

This example returns the detailed move history for the completed move request for Ayla Kol's mailbox. This example uses a temporary variable to store the mailbox statistics object. If the mailbox has been moved multiple times, there will be multiple move reports. The last move report is always MoveReport[0].

Copy Code
$temp=Get-MailboxStatistics -Identity AylaKol -IncludeMoveHistory
$temp.MoveHistory[0]

EXAMPLE 8

This example returns the detailed move history and a verbose detailed move report for Ayla Kol's mailbox. This example uses a temporary variable to store the move request statistics object and outputs the move report to a CSV file.

Copy Code
$temp=Get-MailboxStatistics -Identity AylaKol -IncludeMoveReport
$temp.MoveHistory[0] | Export-CSV C:\MoveReport_AylaKol.csv