Deleted Items in Exchange 2007 SP1

what powershell command can I run to see how many emails have been permanently deleted and are still being retained by the server?

Thanks
sparkisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris DentPowerShell DeveloperCommented:

Covered by Get-MailboxStatistics.

For example, to show each users name, total items and deleted item size you could run:

Get-MailboxStatistics | Select-Object DisplayName, TotalItemSize, TotalDeletedItemSize

Note that this is the value you're after, not the size of the deleted items folder in the mailbox.

The full set of data can be seen with:

Get-MailboxStatistics | Format-List *
Or
Get-MailboxStatistics | Select-Object *

And full help for the  command is available with:

Get-Help Get-MailboxStatistics -Full | more

HTH

Chris
0
Chris DentPowerShell DeveloperCommented:

Hmmm actually, missed a word.

If they're permanently deleted they are not retained by the server. This shows items that have been removed from the mailbox but are waiting final removal once the retention timer expires.

Chris
0
sparkisAuthor Commented:
Chris - but this will give me the "deleted items" in the folders. Not items that are waiting for permanent deletion. That have alread been deleted and are still being retained until permanent removal. Can i view that?
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Rajith EnchiparambilOffice 365 & Exchange ArchitectCommented:
If you want to view it, you don't have to run a command (assuming that you want to recover it). Enable the DumpsterAlwaysOn registry key to recover even hard deleted items from any folders in your mailbox (not just inbox).

http://support.microsoft.com/kb/886205

And then go to Tools  -> Recover Deleted Items and you can see all emails which is waiting to be purged by exchange.
0
Chris DentPowerShell DeveloperCommented:

You mean in the Deleted Items folder? It won't show that, you have to use Get-MailboxFolderStatistics to see inside the mailbox.

Get-MailboxStatistics returns the size (and item count) of items waiting to be purged. These items have already been deleted from the mailbox.

Chris
0
Chris DentPowerShell DeveloperCommented:

I realise now that you wanted the deleted items folder for the other thread. Would you like the stats script re-doing to reflect deleted items within the mailbox?

Chris
0
sparkisAuthor Commented:
No what you provided for me in that last thread was beyond excellent. Thnaks again

I wanted to know if there was a way to see items (count and size) scheduled for perm delete currently being retained on the server.
0
Chris DentPowerShell DeveloperCommented:

That's this one.

It's worth having an example so you can compare.

Run:

Get-MailboxFolderStatistics "You" -IncludedFolder "DeletedItems"

And:

(Get-MailboxStatistics "You").TotalDeletedItemSize

Provided I got the commands right you should see a discrepancy in the values. The first is the folder within the mailbox. The second items which have been completely deleted from the mailbox and are waiting permanent removal on the server.

Chris
0
sparkisAuthor Commented:
It doesnt like -IncludeFolder
0
Chris DentPowerShell DeveloperCommented:

And I didn't... should have been:

Get-MailboxFolderStatistics "You" -FolderScope "DeletedItems"

I should have brought my server home with me ;)

Chris
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.