Get-MailboxStatistics
Applies to: Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3
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.
Syntax
Get-MailboxStatistics [-Identity <GeneralMailboxIdParameter>] [-DomainController <Fqdn>]
Get-MailboxStatistics -Database <DatabaseIdParameter> [-DomainController <Fqdn>]
Get-MailboxStatistics -Server <ServerIdParameter> [-DomainController <Fqdn>]
Detailed Description
To run the Get-MailboxStatistics cmdlet, the account you use must be delegated the following:
- Exchange View-Only Administrator role
For more information about permissions, delegating roles, and the rights that are required to administer Exchange Server 2007, see Permission Considerations.
On Mailbox servers only, you can use the Get-MailboxStatistics cmdlet without parameters. In this case, the cmdlet will return the statistics for all mailboxes on all databases on the local server.
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:
This parameter accepts pipeline input from the Get-MailboxDatabase cmdlet. |
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:
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 do not specify this parameter, the command returns logon statistics for the local server. This parameter accepts pipeline input from the Get-ExchangeServer and Get-MailboxServer cmdlets. |
DomainController |
Optional |
Microsoft.Exchange.Data.Fqdn |
To specify the fully qualified domain name (FQDN) of the domain controller that retrieves data from the Active Directory directory service, include the DomainController parameter in the command. |
Identity |
Optional |
Microsoft.Exchange.Configuration.Tasks.GeneralMailboxIdParameter |
The Identity parameter specifies a mailbox. When you specify a value for the Identity parameter, the command looks up the mailbox that is specified in the Identity parameter, connects to the server where the mailbox resides, and returns the statistics for the mailbox. You can use one of the following values:
This parameter accepts pipeline input from the Get-Mailbox cmdlet. |
Input Types
Return Types
Errors
Error | Description |
---|---|
|
Exceptions
Exceptions | Description |
---|---|
Example
The first example retrieves the mailbox statistics for all mailboxes on the local server.
Note
You can use the Get-MailboxStatistics cmdlet without parameters only on a Mailbox server.
The second example retrieves the mailbox statistics for all mailboxes on the specified server.
The third example retrieves the mailbox statistics for the specified mailbox.
The fourth example retrieves the mailbox statistics for all mailboxes in the specified mailbox database.
The fifth example retrieves the mailbox statistics for all disconnected mailboxes. This example uses a WHERE clause. The $_ variable is used to specify the object that is passed on the pipeline. The -ne operator means "not equal."
Get-MailboxStatistics
Get-MailboxStatistics -Server MailboxServer01
Get-MailboxStatistics -Identity contoso\chris
Get-MailboxStatistics -Database "Mailbox Database"
Get-MailboxStatistics | Where {$_.DisconnectDate -ne $null}