Posts Tagged ‘folder size’

Need a quick and dirty way to check the size of all users’s Deleted Items in your Exchange Mailbox Database – here is a nifty powershell script I concocted from a variety of other scripts on the net.

C:\Windows\system32>Get-Mailbox -ResultSize unlimited | Get-MailboxFolderStatistics | where{$_.FolderType -eq "DeletedItems"} | Select-Object Identity, {$_.FolderAndSubFolderSize.ToMb()}, ItemsInFolderAndSubFolders | Export-Csv c:\deleted_items.csv

It exports the data to a CSV file on the root of the C: drive (deleted_items.csv).

You can open this in Excel and easily use the SUM function to get a total of all the users’s Deleted Items folders.

(I wrote this on an Exchange 2010 server, it should work on Exchange 2007 also, but I haven’t tested this on Exchange 2007.)