Forum Discussion

Darren Rose's avatar
Darren Rose
Brass Contributor
Dec 08, 2018
Solved

Can't empty deleted items folder - Outlook 2016 / Exchange Online Plan 1

Hi

 

Have a problems with Office 365 / Outlook 2016 / Exchange Online Plan 1

 

I have a service mailbox which has 60000 emails in deleted items folder and I can't empty it - tried in Outlook and via OWA - they appear to go but if I refresh they come back

 

Also tried mfcmapi deleting "recoverable items" and "deleted items" as per http://m1econsulting.com/knowledge-base/clear-out-deleted-items-folder-with-mfcmapi-exchange-2010/ which doesn't work

 

Also tried deleting the whole Deleted Items folder as per mention here - https://social.technet.microsoft.com/Forums/ie/en-US/e65534c4-3b35-48ea-b54a-3412af600be3/cant-delete-mails-that-are-in-quotdeleted-itemsquot?forum=officeitpro

 

But that fails with error below:-

 

Warning:
Code: MAPI_W_PARTIAL_COMPLETION == 0x00040680
Function lpParentFolder->DeleteFolder( lpItemEID->cb, reinterpret_cast<LPENTRYID>(lpItemEID->lpb), lpProgress ? reinterpret_cast<ULONG_PTR>(m_hWnd) : NULL, lpProgress, ulFlags)
File c:\projects\mfcmapi\ui\dialogs\hierarchytable\msgstoredlg.cpp
Line 788

 

Mailbox is now just under its 50gb limit and problem is getting urgent as this mailbox processes emails automatically so needs to be working

 

 

Any ideas please?

  • Darren Rose's avatar
    Darren Rose
    Dec 08, 2018

    Hi Chris

     

    Thanks for your reply and the suggested article which has certainly given me some useful notes for next time I have a problem

     

    In the end as the mailbox is critical to our business (process incoming mail for a document management system), I logged a support call with Microsoft and a really helpful chap advised it was due to the 14 day retention policy on mailbox not working and used some powershell commands to get it working

     

    So fingers crossed the 60000+ items in deleted items has now started to go down and 99% of my 50Gb used is now 85% so much improved

     

    Thank you for your reply

19 Replies

  • Darren Rose and others, let me be of some assistance here. After a 10 day odyssey with Microsoft support there are specific reasons why deletion is not possible, especially as the mailbox gets to 100% full. It involves multiple steps to solve and will take some machine time to complete, but I will provide some Powershell steps to assist you. PLEASE NOTE, you will be permanently deleting items in the Deleted Items box in this process and they will NOT be recoverable! You can change things back to defaults after completion.

     

    First, create a deleted items policy for the mailbox in question by going to EAC, Compliance Management, Retention Tags. Hit the + sign and "apply automatically to a default folder." Choose Deleted Items as the default folder, then click Permanently Delete, Retention Period should be Never.

     

    Now, go to Retention Policies, and create a new policy, name it, and go to + sign for Retention Tags and add the one tag you just created and save the policy.

     

    Next, go to the mailbox in question, click on Mailbox Features, and add change the Retention Policy to the new one you just created and save.

     

    Now, open up Powershell and connect to Exchange Online (I use connect-ExchangeOnline command with modern authentication, as I've added these cmdlets to my Powershell environment, but you can still use the downloadable Exchange Powershell and connect-EXOPSession command if you like, they are both the same thing).

     

    Force update to the retention policy by typing:

    Start-ManagedFolderAssistant -Identity <email-address-of-affected-mailbox>

     

    You may have to wait up to 24 hours, but things should delete that can be deleted, but you're not done yet.

     

    Open EAC, and go to Permissions and add your account you log into Powershell with to the Discovery Management object under Admin Roles. You will have to wait about 10 minutes for this to take effect.

     

    Open Powershell and connect to Exchange Online again, and send this command:

    Get-ManagementRole -Cmdlet Search-Mailbox

    This will add the "search-Mailbox" command and associated cmdlets to your shell for the next command to work:

    search-mailbox -identity <email-address-of-affected-mailbox> -searchdumpsteronly -deletecontent

    The above command will take sometimes hours to complete, and mail fail with a Store connect failure, but simply re-run it until it returns a cursor.

     

    After that, you should be able to go to the Deleted Items folder on the affected mailbox using OWA and delete all mail. Don't forget to purge all deleted items after you so this so they are non-recoverable (this cannot be undone!). After all this, the "dumpster" command above can be re-run to make sure any add'l email is removed.

     

    You may then check the dumpster size with this command:

    Get-MailboxFolderStatistics -Identity <email-address-of-affected-mailbox> -Folderscope RecoverableItems | select name,foldersize,ItemsInFolder

     

    When done, it is advisable you REMOVE yourself as a member from the Discovery Management object in EAC/Permissions/Admin Roles so you do not accidentally delete permanent objects.

     

    Hope this helps. It was painful, but that got a mailbox from 100+% down below 10%.

     

    JB

  • AndreKotze's avatar
    AndreKotze
    Copper Contributor

    For me it turns out a previous admin had enabled the "Preservation Lock" option which means that anything not older than 5 years cannot be purged from the Recoverable Items folder.

  • AndreKotze's avatar
    AndreKotze
    Copper Contributor
    I'm having the exact same problem with an Exchange Online mailbox. Using PowerShell I was able to locate about 166000 emails from Dec 2017 to April 2019 worth 100GB which are stuck in the Purges folder but no matter what I do I'm unable to delete them.

    The PowerShell commands MS Support gave me didn't work and with MFCMAPI I'm also not able to delete them.

    Any advise would be greatly appreciated...
    • Chochi's avatar
      Chochi
      Copper Contributor

      AndreKotze 

       

      I am experiencing also... no Powershell scripts are working. When we delete items, they show back up in seconds. Issue is our 100GB mailbox limit keeps getting maxed out and I cant delete anything to make space. No litigation holds. 

       

      Things tried:

      1. Search-Mailbox "mymailbox@contoso.com" -SearchQuery ‘(received=2018-01-01..2019-11-01)(sent=2018-01-01..2019-11-01)’ -DeleteContent -Force
      2. Start-ManagedFolderAssistant "mymailbox@contoso.com"
      3. Delete via OWA - items delete "temporarily" then reappear. 
      4. Tried using MFCMapi to delete the contents of the Deleted Items and Recovery Items
      5. New Exchange MRM Policy (delete anything 7 days or older)
      6. Enable a ExOL Archive mailbox, create a new Exchange MRM Policy to move anything older than 7 days to archive. 
      7. Delete from the Outlook client obviously... cached and uncached mode. 

       

      Results: 

      Get-MailboxFolderStatistics "mymailbox@contoso.com" -FolderScope "RecoverableItems" | Format-List Name,FolderAndSubfolderSize

       

      Name : Recoverable Items
      FolderAndSubfolderSize : 110 GB (118,111,612,814 bytes)

      Name : DiscoveryHolds
      FolderAndSubfolderSize : 92.84 GB (99,683,338,775 bytes)

       

      Get-MailboxFolderStatistics "mymailbox@contoso.com" -FolderScope "DeletedItems" | Format-List Name,FolderAndSubfolderSize

       

      Name : Deleted Items
      FolderAndSubfolderSize : 79.86 GB (85,753,721,801 bytes)

       

       

      None of the above worked. 

      So this is very frustrating to say the least. MS ticket open but no fix at this time. 

       

    • Darren Rose's avatar
      Darren Rose
      Brass Contributor

      Hi Chris

       

      Thanks for your reply and the suggested article which has certainly given me some useful notes for next time I have a problem

       

      In the end as the mailbox is critical to our business (process incoming mail for a document management system), I logged a support call with Microsoft and a really helpful chap advised it was due to the 14 day retention policy on mailbox not working and used some powershell commands to get it working

       

      So fingers crossed the 60000+ items in deleted items has now started to go down and 99% of my 50Gb used is now 85% so much improved

       

      Thank you for your reply

      • jimbarrgpboston's avatar
        jimbarrgpboston
        Brass Contributor

        Darren Rose Years later, 4 separate support tickets, multiple "I understand the frustration you are feeling" phone calls with support, and this is still an issue. Nothing works. I am, to be honest, dumbfounded by the simplicity of this request and the inability of the Great Monopoly Microsoft to comply with a simple "select," and "delete" command that would enable the removal of the trash and recoverable data.

Resources