Forum Discussion
Can't empty deleted items folder - Outlook 2016 / Exchange Online Plan 1
- 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
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
jimbarrgpboston - Excellent explanation - bookmarked for future reference - thanks