Exchange 2010 - View all users deleted items folder

bjennings
bjennings used Ask the Experts™
on
Hello Everyone,

I want to find out everyone's "deleted Items" folder size in exchange 2010.  When I  run the following powershell command

Get-Mailbox | Get-MailboxStatistics | sort TotalDeletedItemSize -descending | ft DisplayName,TotalDeletedItemSize, FolderPath > c:\deleteditems.csv

I get a list of their "deletions" folder and not "deleted items" folder.

Does anyone know the powershell command to view the size of everyone's "deleted items" in exchange 2010?

Thanks,

Bill
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Patrick BogersDatacenter platform engineer Lindows

Commented:
Hi

To export you need to change the "ft" to "Select-Object" afaik.
Try this

Get-Mailbox | Get-MailboxStatistics | sort TotalDeletedItemSize | Select-object DisplayName,TotalDeletedItemSize | export-csv c:\deleteditems.csv

Author

Commented:
Hello Patricksr1972,

Thanks for the suggestion, but it did not work.

When I run the following command:

Get-MailboxFolderStatistics -id  testuser@acme.com| Sort-Object
FolderSize -Descending | FT  folderpath, foldersize, ItemsinFolder -autosize

I get the following result

FolderPath                     FolderSize                      ItemsInFolder
----------                     ----------                      -------------
/Deleted Items              5.786 GB                          10000
/Sent Items                    2.936 GB                             40000
/Inbox/Test                    267.7 MB                               1050

When I run the command you gave me
Get-Mailbox | Get-MailboxStatistics | sort TotalDeletedItemSize | Select-object DisplayName,TotalDeletedItemSize | export-csv c:\deleteditems.csv

I get the following result for the same user

Test User      59.56 MB

I am trying to find the size of all "delete Items" folder for everyone in the company.

Thanks,

Bill
FOXActive Directory/Exchange Engineer
Top Expert 2015

Commented:
Are you trying to get the size of the  deleted items folder  per user or the total deleted items size of the whole company?
very very very simple

Get-Mailbox -mailboxsize unlimited| Get-MailboxFolderStatistics | ?{$_.name -like "*delete*"} | select Identity,name,FolderSize,FolderAndSubfolderSize | export-csv C:\report.csv

Author

Commented:
It worked!  Thanks so much!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial