PowerShell for Exchange: A Script that Helps Generate Mailbox Reports
- select the contributor at the end of the page -
If you are looking for basic information on mailbox databases and their size and such you can always use the Get-MailboxDatabase cmdlet. For more information on the cmdlet itself just open the Exchange Management Shell and type: Get-Help Get-MailboxDatabase (note: for examples just append a –Examples to the end of that command). One example of how you might use that command is to narrow down to a specific database and look for information on mailbox data within using the following:
Get-MailboxDatabase "DB1" | Get-MailboxStatistics | Sort TotalItemSize -desc | ft displayname, totalitemsize, itemcount
Note: Another way to accomplish the same thing is with the Get-Mailbox cmdlet using the following command:
Get-Mailbox -Database DB1 | Get-MailboxStatistics | ft displayname,totaldeleteditemsize,totalitemsize
Learn more about these cmdlets and their use from ExchangeServerPro.com here:
- Browsing Mailbox Databases in Exchange 2007 and 2010
- How to Calculate Exchange 2010 Mailbox Sizes with PowerShell
Get-MailboxReport.ps1 - PowerShell Script that Generates Mailbox Reports
Now Paul has taken his knowledge to the next level and has put together a great script to help you generate a report that does, as he puts it, "all the heavy lifting" for Exchange admins. The script will get information about a server, a database, a mailbox or list of mailboxes and it will put the output in a .csv file for you (unless you just run the mailbox query, which will just be displayed onscreen).
Learn more about this cool script in the video below and download it from Paul's site here:
Ready to test your skills in Powershell? See how they stack up with this assessment from Smarterer. Start this Powershell test now.