o365 deleted items folder has 1 million items. What is the correct powershell command to remove all?

o365 deleted items folder has 1 million items.   What is the correct powershell command to remove all?
Facts:
1. It is a shared mailbox
2.  It has a litigation hold enabled
3.   The purge folder is at 100gb and has over 2 million objects in it.
LVL 22
FOXActive Directory/Exchange EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Jason CrawfordTransport NinjaCommented:
With litigation hold enabled nothing will be permanently deleted
0
FOXActive Directory/Exchange EngineerAuthor Commented:
I understand that as they will be in a Purged folder but how do I clean out this Deleted items folder
0
Jason CrawfordTransport NinjaCommented:
Control + A Shift + Delete
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

FOXActive Directory/Exchange EngineerAuthor Commented:
That has not been working. The deleted items reappear.   I have set a retention policy on it with a tag to delete all out of the deleted items folder after 2 days.    The items still remained.
0
Jason CrawfordTransport NinjaCommented:
I'm guessing your Recoverable Items folder is full.  What do you have the quota set to?  You may want to enable archive mailboxes:

https://support.office.com/en-us/article/Increase-the-Recoverable-Items-quota-for-mailboxes-on-hold-a8bdcbdd-9298-462f-b889-df26037a990c
0
aikimarkCommented:
I advise you to consult lawyer and get advice in writing before deleting anything.
0
Gopi RajuSystem EngineerCommented:
You can use the retention policies to delete the items from deleted items.

Try running the below command

Search-mailbox -identity <alias> -SearchDumpsterOnly -DeleteContent
0
FOXActive Directory/Exchange EngineerAuthor Commented:
All,
After consulting with other members on my team we found out that this mailbox was receiving system generated emails and the litigation hold was not necessary.  Once I disabled the litigation hold I was able to run the command Gopi listed which cleaned out over 2 million items in the purged folder.  I was then able to delete all items from the deleted items folder from a regular "Empty folder" via the gui in OWA for this mailbox.
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
FOXActive Directory/Exchange EngineerAuthor Commented:
I had to remove the litigation hold in order to clean out the purges folder which had over 2 million items which in turn let me clean out the deleted items folder
0
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
Powershell

From novice to tech pro — start learning today.