How to Purge the Exchange 2010 Dumpster and recover white space instantly

How to Purge the Exchange 2010 Dumpster and recover white space instantly

Summary

If you manage an on-premise Exchange server you’d realise quickly that however huge the disk space was when Exchange server was commissioned that the used space has a funny way of catching up faster than you expected. A key take away with the way Exchange uses its database file is that it never automatically shrinks. So deleting a huge mailbox or asking your users to perform cleanup of their old emails isn’t going to reduce the free space in the partition where your Exchange database resides. What you can do is to monitor the so called white space on a database.

One of the usually forgotten areas to perform a cleanup is on the Deleted  Items folder. It’s surprising how many users want to hold on to all emails – even those deleted months or even years back. The Deleted Items should be cleared as collectively it is a huge wasted space and may affect Exchange and Outlook performance.

Below is the procedure to force the purging of the Recoverable Items\Deletions folder (aka the Dumpster) for a mailbox. The effect is instant and will result to an

  • immediate decrease in the mailbox size
  • immediate increase of the available/white space in the mailbox database of the user.

Background

Exchange 2010 has made significant changes in the way deleted items are handled. Once an email item (message, calendar, contact, etc) is deleted in Outlook it ends up in the Deleted Items folder. The items accumulate here over time, are still part of the mailbox and eat up storage.

If the items are hard-deleted (by pressing Shift – Delete) or if the Deleted Items folder is emptied, the messages end up in the Dumpster. Each mailbox has its own Dumpster. However, it still takes up storage space. It will get automatically purged after 14 days (this is default setting) as part of the regular Exchange maintenance in the background.

In general, the cleanup steps are below:

  • Export a list showing the Deleted Items folder size of each mailbox
  • Empty the Deleted Items folder in Outlook
  • Purge the Dumpster

Note: some steps can be skipped depending on what activity is required.

 

Export a list showing the Deleted Items folder size of each mailbox

  1. Open EMS and run the below cmdlet (this is one long command)
Get-Mailbox -ResultSize Unlimited | Get-MailboxFolderStatistics | where{$_.FolderType -eq "DeletedItems"} | Select-Object Identity, {$_.FolderAndSubFolderSize.ToMb()}, ItemsInFolderAndSubFolders | Export-CSV C:\temp\DeletedItems.csv
  1. Sort according to folder size and identify candidates for cleanup.

 

Empty the Deleted Items folder in Outlook

  1. Discuss with the user the effect of emptying their Deleted Items folder (improved Outlook performance, can’t recover items once emptied, etc)
  2. In Outlook, right click the Deleted Items folder and select Properties.
  3. Click Folder Size button and take note of the Total size of the folder. This is an indication of how much white space that can be recovered. Click Close.
  4. In Outlook, right click the Deleted Items folder and select Empty Folder. Click Yes. This may take a few minutes depending on the size of the folder.

Purge the Dumpster

  1. View the size of the mailbox and how much space is consumed by the mailbox’s Dumpster. Go to EMS and run the below three cmdlets.
Get-MailboxStatistics -Identity <mailbox alias> | Select DisplayName,ItemCount,TotalItemSize
Get-MailboxStatistics -Identity <mailbox alias>| select DisplayName,TotalDeletedItemSize
Get-MailboxFolderStatistics -Identity <mailbox alias> -FolderScope RecoverableItems | Select Identity,ItemsInFolder,FolderAndSubfolderSize

Purge-Dumpster1

2.View how much white space is available in the mailbox database using the below cmdlet.

Get-MailboxDatabase -Status | ft Name,DatabaseSize,AvailableNewMailboxSpace –auto

Purge-Dumpster2

3. Purge the Dumpster using the below cmdlet. This may take a few minutes but the effect is immediate (ie mailbox size should decrease and database white space should increase instantly).

Search-Mailbox -Identity <mailbox alias> -SearchDumpsterOnly –DeleteContent

Purge-Dumpster3

4. Run the commands in #1 and #2 above to confirm the changes took effect

        Purge-Dumpster4

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s