Book Image

Microsoft Exchange 2010 PowerShell Cookbook

Book Image

Microsoft Exchange 2010 PowerShell Cookbook

Overview of this book

Table of Contents (22 chapters)
Microsoft Exchange 2010 PowerShell Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Generating mailbox folder reports


The ability to generate reports based on individual mailbox folders can be extremely useful at times. The Exchange Management Shell provides a versatile cmdlet called Get-MailboxFolderStatistics that allows you to obtain detailed information about specific mailbox folders such as the Inbox, Sent Items, Deleted Items, and more. Various pieces of information about these folders can be obtained including the total number of items, the size of the folder, and the folder ID. In this recipe, you will learn how to generate reports using the Get-MailboxFolderStatistics cmdlet.

How to do it...

To generate a report for the folders within a user's mailbox, use the following command:

Get-MailboxFolderStatistics -Identity testuser -FolderScope All | 
  select Name,ItemsInFolder,FolderSize | 
    Export-CSV C:\MB_Report.csv -NoType

How it works...

In this example, we are executing a one-liner that generates a report of the mailbox folder statistics for the testuser mailbox...