O365 Deleting Items

We have a user who would like to delete or purge all his emails in the ‘Recover deleted items’ He can do this one at a time but he would like to select all. Can he do that or is there a power shell command we can run to do this for him?

Thanks
LVL 1
QuarmAsked:
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.

Vasil Michev (MVP)Commented:
Newer versions of Outlook offer the functionality to purge/recover all messages from the "Recover deleted items" container. If you are using an older one, then it will be indeed more painful experience.

But yes, you can do it via PowerShell, however you have to use some EWS-based script as the "regular" PowerShell cmdlets cannot target specific folders. Instead, you need to use EWS with either Full Access permissions or impersonation, bind to the folder (recoverableitemsdeletions) and Empty it. this article should get you started: https://msdn.microsoft.com/en-us/library/office/dn424760(v=exchg.150).aspx
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
IvanSystem EngineerCommented:
Hi,

you can connect to Exchange Online via PS> https://technet.microsoft.com/library/jj984289.aspx
Then use following command to delete all Recoverable items from users mailbox:
Search-Mailbox <username> -SearchQuery size>0 -SearchDumpsterOnly -DeleteContent

More info can be found on: https://support.office.com/en-gb/article/Delete-items-in-the-Recoverable-Items-folder-of-cloud-based-mailboxes-on-hold-Admin-Help-a85e1c87-a48e-4715-bfa9-d5275cde67b0

Regards,
Ivan.
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
Exchange

From novice to tech pro — start learning today.