Book Image

Microsoft Exchange Server PowerShell Cookbook

Book Image

Microsoft Exchange Server PowerShell Cookbook

Overview of this book

Table of Contents (21 chapters)
Microsoft Exchange Server PowerShell Cookbook Third Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Reporting on mailbox database size


It was quite difficult in Exchange 2007 to determine the size of a mailbox database using PowerShell. At that time, the Get-MailboxDatabase cmdlet did not return the size of the database, and instead, you had to use the cmdlet to determine the path to the EDB file and calculate the file size using the Get-Item cmdlet or WMI. With Exchange 2010, this was changed and determining the size information turned out to be very simple, and the information can easily be retrieved using the Get-MailboxDatabase cmdlet. In this recipe, we will take a look at how to report on the mailbox database size using the Exchange Management Shell for Exchange 2013.

How to do it...

To retrieve the total size of each mailbox database, use the following command:

Get-MailboxDatabase -Status | select-object Name,DatabaseSize

The output from this command might look something like this:

How it works...

When running the Get-MailboxDatabase cmdlet, we can use the -Status switch parameter to...