Exchange administrators need to know how much data users store in their mailboxes. Having this data on hand helps admins with capacity planning and quota management. Exchange Server 2007 introduced the Get-MailboxStatistics cmdlet, which allows admins to extract mailbox statistics and export data to an HTML report.
The Get-MailboxStatistics cmdlet requirement
There are a range of optional parameters you can use in conjunction with the Get-MailboxStatistics cmdlet; however, you must always use a parameter that tells the cmdlet what it will run against: a specified mailbox, mailbox server or mailbox database. Figure 1 shows three examples of how the Get-MailboxStatistics cmdlet can be used.
In the first example, I appended the –Identity switch to the cmdlet, along with a user’s alias. This instructs Exchange server that I want to retrieve statistics for a specific mailbox.
In the second example, I appended the –Server switch to the Get-MailboxStatistics cmdlet. After running the cmdlet with this switch, Exchange provides information for mailboxes residing on the specified mailbox server.
The third example shows how to use the –Database switch to specify a particular mailbox database. There are a couple things to pay attention to with this scenario:
I didn’t specify a server name, but Exchange was able to find the database. In Exchange 2010, databases are an organization-level feature and reside on multiple mailbox servers.
The server output and database output often aren’t as similar as they are in this example. In some cases, a mailbox server will contain multiple databases; performing a server-level query can return results from across multiple databases.
The Get-MailboxStatistics cmdlet and Exchange 2010 changes
The Get-MailboxStatistics cmdlet supports some new features in Exchange Server 2010, such as the ability to view an Exchange 2010 mailbox’s move history. There are a few options you can choose from to view a mailbox’s move history.
The first option is to view the move history as a brief summary. To do so, include the –IncludeMoveHistory switch (Figure 2). In this example, I formatted the output as a list to display move history information.
To obtain more detailed information about a mailbox’s move history, use the –IncludeMoveReport switch. Additionally, the cmdlet’s output must be written to a variable before it can be displayed. After this is done, you can display the variable’s content to view the full move history information (Figure 3).
Exchange Server 2010 also allows you to create a secondary mailbox for users, which is also known as an archive mailbox. To retrieve information for an archive mailbox, simply include the –Archive switch within the Get-MailboxStatistics cmdlet.
Figure 4 shows a report of User1’s archive mailbox. You can tell this is the archive mailbox because the IsArchiveMailbox parameter is listed as True. You’ll also notice that both the ItemCount and AssociatedItemCount values are different than they were in Figure 2.
ABOUT THE AUTHOR
Brien M. Posey, MCSE, is a seven-time Microsoft MVP for his work with Windows 2000 Server, Exchange Server and IIS. He has served as CIO for a nationwide chain of hospitals and was once in charge of IT security for Fort Knox. For more information visit www.brienposey.com.
This was first published in November 2010