Checking your Exchange database size in PowerShell is key in several scripting scenarios, such as creating mailboxes in the smallest database, or generating basic database reports. The problem in Exchange 2007 was that this was a lot harder than it sounded. The Get-MailboxDatabase cmdlet did not return the size of the database. If you needed to determine the database size, you had to write some fairly lengthy code to get what you think would be be easily accessible information.
Exchange 2007
There are a couple methods you can use to get this information in Exchange 2007. Here is a great example posted by Gary Siepser; it’s a one-liner that retrieves the database size using WMI, allowing you to run it against clustered mailbox servers:
Exchange 2010
Fortunately, the Get-MailboxDatabase cmdlet in Exchange 2010 provides this information for us out of the box. All you need to do is use the Status parameter and you can access the information using the DatabaseSize property. Here is an example:
Exchange 2013
You can use same procedure like in Exchange 2010.