Exchange – Get database size (Exchange 2007)

Problem
You need to get the size of all exchange databases

 

Solution
In exchange powershell window execute the following command

get-mailboxdatabase -includepre | foreach-object{select-object -inputobject $_ -property *,@{name=”MailboxDBSizeinGB”;expression={[math]::Round(((get-item (“\\” + $_.servername + “\” + $_.edbfilepath.pathname.replace(“:”,”$”))).length / 1GB),2)}}} | Sort-Object mailboxdbsizeinGB -Descending | format-table identity,mailboxdbsizeinGB -autosize

myite-exch-01

 

Tested Platform
Exchange 2007

Hits: 104

Leave a Reply