MSExchangeGuru.com

Learn Exchange the Guru way !!!

 

Exchange 2010 Recoverable Items folder TotalDeletedItemsSize issue!

This is a tip to address an issue where Exchange 2010 TotalDeletedItemsSize remains unaltered after trying to empty it out.

As per TechNet:

Clean Up the Recoverable Items Folder: http://technet.microsoft.com/en-us/library/ff678798(v=exchg.141).aspx

Search-Mailbox “username” -SearchDumpsterOnly –DeleteContent

Should do it but seems like it won’t clear TotalDeletedItemsSize

Use MailboxStatistics cmdlet to confirm this.


To clear this, we need to clear the Calendar Version Logging!

From TechNet blog-

The recovery items folder has its own root folder and also contain the following sub-folder.

Deletions: This subfolder contains all items deleted from the Deleted Items folder.

Versions: If either litigation hold or single item recovery is enabled, this subfolder contains the original and modified copies of the deleted items. This folder isn’t visible to end users.

Purges: If either litigation hold or single item recovery is enabled, this subfolder contains all items that are hard deleted. This folder isn’t visible to end users.

Audits:  If mailbox audit logging is enabled for a mailbox, this subfolder contains the audit log entries.

Note that the RecoverableItemsRoot contains Calendar Version changes, which are needed for calendar diagnostics, these changes are stored when a user updates an appointment to calendar or when a meeting organizer sends meeting updates to attendees.

Calendar Version Logging is the process by which calendar changes that occur within a mailbox are saved via copy-on-write. Calendar Version Logging was introduced in Exchange 2010 to help troubleshoot and repair calendar reliability issues.

The design of Calendar Version Logging is to create a log every time a calendar item has been changed. These logs provide a history of the meeting. You can use the Get-CalendarDiagnosticLog cmdlet to review the history and determine which clients performed a destructive action. The second use for Calendar Version Logging is by the Calendar Repair Assistant, which uses the logs when trying to determine the history of a given calendar item for inconsistency detection.

Calendar Version Logging is enabled by default on mailboxes in Exchange 2010. You can disable or enable this on a mailbox via the CalendarVersionStoreDisabled property. Note, the property name is CalendarVersionStoreDisabled, so the default value of $false means that Calendar Version Logging is enabled by default.  Depending on the mailbox configuration, a different process is followed for storing copies of the calendar items:

  1. If the mailbox is not enabled for Single Item Recovery or Litigation Hold, then stripped versions of calendar items are maintained in the root of the Recoverable Items folder for 120 days. The stripped versions (body and non-first level or non-embedded message type attachments are removed) are created using copy-on-write.
  2. If the mailbox is enabled for Single Item Recovery or Litigation Hold, full copies of the calendar items are maintained in the Recoverable Items\Deletions or Recoverable Items\Versions folders. A stripped version is created via the copy-on-write infrastructure whenever a hard delete operation is performed against the calendar item in the Recoverable Items\Deletions or Recoverable Items\Versions folders. This stripped version is placed in the root of the Recoverable Items folder and kept for 120 days. The only time a stripped version is not created is when the item’s age in the Recoverable Items\Deletions or Recoverable Items\Versions folder is more than 134 days (120 + 14). This can happen if you change the retention period, if the Mailbox Folder Assistant hasn’t been executing, if Litigation Hold was disabled, etc.).

Due to the aforementioned issue with how the copy-on-write logic did not distinguish between flush and Save operations, Calendar Version Logging, in some cases, could consume a large percentage of the Recoverable Items folder quota (and if you recall, the warning threshold is 20GB and the hard quota is 30GB).

The famous iOS 6.1 issues with calendaring also caused excessive growth of this folder.

So, let’s now run the following cmdlet which will clear the Recoverdeleteitems folder.

Set-Mailbox -Identity “ratish” -CalendarVersionStoreDisabled:$True

Start-ManagedFolderAssistant -Identity “ratish”

It would probably be a good idea if you could open the folder using MFCMapi to see the actual contents. To do so:

1.) Provide full access to the mailbox to the account you are using

2.) Go to control panel > mail > profiles > ask for a profile each time outlook opens

3.) Open Outlook > New profile > input appropriate info for mailbox and users alias > UNCHECK “cached exchange mode” > open the users mailbox once w/ Outlook, then close Outlook.

4.) Open MFCMapi (if Outlook is x64, then use x64 of MFCMapi)

5.) Click > Session > Logon and display store table

6.) Select the profile for the user you added.

7.) Double click “mailbox – user”

8.) Expand “Root Container” > right click on “Recoverable Items” and select > open contents table

9.) Give it a min to enumerate all items

10.) Select any unwanted items and right click “delete message”

11.) You can also expand recoverable items and then highlight purge or deletions and open the contents table for those as well.

12.) Then close windows until you get the original one and logoff.

Note that Managed folder assistant is throttled in so far as it runs on a work cycle basis so that each mailbox in a database is processed daily. You shouldn’t run these cmdlets for all mailboxes on a database at the same time. Run in batches of 10 or 20.

Also,

1. Confirm the workcycle is set to 1 day (the default) by running the following Powershell command:

Get-MailboxServer ServerName| fl Name, ManagedFolderWorkCycle

2. On the mailbox server hosting the active database copies, look for event 10027 (MSExchangeMailboxAssistants) in the Application event log.  This provides a summary of the number of items deleted during the previous work cycle.  It may provide clues as to what is (or is not) happening.

Log Name:      Application

Source:        MSExchangeMailboxAssistants

Date:          3/26/2013 1:13:38 PM

Event ID:      10027

Task Category: Managed Folder Assistant

Level:         Information

Keywords:      Classic

User:          N/A

Computer:      ServerName

Description:

Statistics of MRM expiration at end of this work cycle:

      TotalItemsSoftDeleted:  0

       TotalItemsPermanentlyDeleted:  1216859

       TotalItemsMoved:  0

       TotalSizeItemsSoftDeleted:  0 Bytes

      TotalSizeItemsPermanentlyDeleted:  13625982941 Bytes – 12GB

      TotalSizeItemsMoved:  0 Bytes

       TotalItemsWithPersonalTag:  0

       TotalItemsWithDefaultTag:  0

       TotalItemsWithSystemCleanupTag:  0

       TotalItemsExpiredByDefaultExpiryTag:  0

       TotalItemsExpiredByPersonalExpiryTag:  0

              TotalItemsMovedByDefaultArchiveTag:  0

              TotalItemsMovedByPersonalArchiveTag:  0

3. Use perfmon to examine the following counters:

MSExchange Managed Folder Assistant\Size of items permanently deleted (in bytes)
MSExchange Managed Folder Assistant\Items permanently deleted

To get the list of all Mailboxes in a mailbox database, use

Get-MailboxDatabase DBname | Get-Mailbox –ResultSize Unlimited | FT Alias >>.\alias_DB3.txt

Once you complete the step, select a user and run the cmdlet to see if all 4 folders are now emptied.

Get-MailboxfolderStatistics rsn1005 |ft name, ItemsInFolder, FolderSize -AutoSize

All 4 folders should ideally be empty – its not in my case because I haven’t ran it yet.

To get the MailboxSatatistics for all users on a mailbox database, run this

Get-MailboxDatabase DB3 | Get-Mailbox –ResultSize Unlimited | Get-MailboxStatistics |ft DisplayName, DatabaseName, *item* -AutoSize

Again, remember not to throttle the server by running the cmdlet for all users at once. In case if you are reading this article after running all these cmdlets and seeing no success, maybe that is what happened.

CMDlets to run:

Set-Mailbox -Identity “ratish” -CalendarVersionStoreDisabled:$True

Search-Mailbox “ratish” -SearchDumpsterOnly –DeleteContent

Start-ManagedFolderAssistant -Identity “ratish”

You can use the get-Content switch to run in batches of 10 or 20

A special thanks to MVP Tony Murray, Tony Redmond and MSFT Bharat Suneja for their help.

Ratish Nair
MVP Exchange
Team@ MSExchangeGuru

15 Responses to “Exchange 2010 Recoverable Items folder TotalDeletedItemsSize issue!”

  1. NeWay Technologies – Weekly Newsletter #36 – March 28, 2013NeWay | NeWay Says:

    […] Exchange 2010 Recoverable Items folder TotalDeletedItemsSize issue! – […]

  2. Blog Post from the Week (17th - 30th March 2013) - The South Asia MVP Blog - Site Home - TechNet Blogs Says:

    […] Exchange 2010 Recoverable Items folder TotalDeletedItemsSize issue! […]

  3. Rich Says:

    I’ve been trying to remove deleted items for over a week using EMS and EMC without progress; fortunately came across your instructions, which worked! Thanks.

  4. John Panicci Says:

    This is great info, im having same issue, but apparently my “archive” mailbox has giant TotalDeletedItems. how can I specifically permanently remove these items from archive and not both mail mailbox and archive. I have used mfcmapi and confirm most of the entries are calendaring related. Im guessing that the retention policies I have in place are archiving the RecoverableRoot as well.. how can I stop this?

  5. Kaffiend Says:

    Thanks.

    I had this issue of a particular mailbox being much larger (about 6 times larger) than what Outlook and the EMC was reporting. After some research, I found out that it was this user’s Recoverable Items folder. I thought my troubles were over – but no. I ran the commands to remove the contents of this folder, but no change in the size of the Recoverable Items folder.

    Then, I stumbled across your article. What a relief. As I type this, the Recoverable Itess folder for this user mailbox has gone down from 9Gb, down to about 7Gb. In a little while more, it should be back to zero.

    Thanks again.

  6. Chris King Says:

    I have been wondering for months why my database has been growing much more than the size of my mailboxes.
    I tried to move a 300MB mailbox and it took forever. The move wizard indicated that the mailbox size was 7GB!
    Then I checked out the TotalDeletedItemSize folder – 6.7GB!!!!
    After implementing your guide, I have reduced the total size back to 300MB.
    In order to delete content you have to assign the export import role to a security group: http://technet.microsoft.com/en-us/library/ee633452.aspx
    Thank you for this guide!
    Chris

  7. Paolo Says:

    You deserve a golden statue 50 meters high for this post.
    Thank you, you saved me from a lot of pain in…..

  8. TM Says:

    If you do not want to make a mistake with the -DeleteContent….you can use the MFA. See below.,,

    Get-MailboxFolderStatistics -Identity “mailbox name” | fl fo*, it*
    Set-Mailbox “mailbox name” -SingleItemRecoveryEnabled $false -LitigationHoldEnabled $false
    Set-Mailbox “mailbox name” -CalendarVersionStoreDisabled $true
    Set-Mailbox -Identity “mailbox name” -RetainDeletedItemsFor 00.00:00:00 -UseDatabaseRetentionDefaults $false
    Start-ManagedFolderAssistant -Identity “mailbox name”
    Get-MailboxFolderStatistics -Identity “mailbox name” | fl fo*, it*

    After the /versions folder is clear:
    Set-Mailbox “mailbox name” -SingleItemRecoveryEnabled $true -LitigationHoldEnabled $false
    Set-Mailbox “mailbox name” -CalendarVersionStoreDisabled $false
    Set-Mailbox -Identity “mailbox name” -RetainDeletedItemsFor 17.00:00:00 -UseDatabaseRetentionDefaults $true
    Verify all settings are back to normal on the users account:
    Get-Mailbox -Identity “mailbox name” | fl

  9. Jan Jurcik Says:

    Hello Ratish,
    works like a charm! Amazing solution.

    Exactly as Paolo wrote – golden statue for you. Definitely!

    Many thanks!

    //BR Jan

  10. Manoj Says:

    Thanks Ratish. This works like a charm. You saved the day again. Had used it a few months back to delete 6.5 million items from the dumpster for a user totalling 30gb (took a few days) and just used it to clear 0.5 million items of 15gb for another user last weekend.
    Keep up the wonderful work of sharing easy to understand and use scripts for our daily work.
    Cheers
    Manoj

  11. MMatt Says:

    Thank you! Fixed on of my user’s locked up mailbox.

  12. Antony Mathew Says:

    This article saved my day
    many many thanks to Ratish

  13. Devin Says:

    We’re having this issue with Exchange 2010 SP3, but none of the commands are helping. The items are stuck in the users purges folder and we can’t delete them with MFC Mapi, or using the commandlett. Do we need to give it more time? The worst user has 90Gb of data in the purges folder.

  14. Devin Says:

    Thank you TM! Your method worked, where as using MFCMapi or the -deletecontent switch failed us. I appreciate the comment!

  15. Dilip Menon Says:

    Hi Ratish,

    Firstly, Thanks a lot!! Whenever i get stuck with Exchange, your articles save me 🙂 Appreciate the way these articles are written. Keep going.

    Thanks
    Dilip

Leave a Reply

migrate exchange to office 365

Categories

Archives