Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Purge all deleted items folders on Excahange 2013 Database

Posted on 2016-09-01
4
Medium Priority
?
76 Views
Last Modified: 2016-09-24
Looking at a script to purge all deleted items for all users on an exchange database.

Exchange Version = 2013
Folder to Purge = Deleted Items

I have been looking at scripts from 2010 but can't get search-mailbox / export-mailbox to work.

Any help would be greatly appreciated.

Matt
0
Comment
Question by:HRSB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Ibrahim Benna
ID: 41779793
0
 
LVL 16

Accepted Solution

by:
Todd Nelson earned 2000 total points (awarded by participants)
ID: 41782546
I would recommend setting up retention tags to delete all items in the deleted folder after X number of days, add the tags to a retention policy and apply that policy to the user mailboxes in the specific database.

Retention tags and retention policies ... https://technet.microsoft.com/en-us/library/dd297955(v=exchg.150).aspx

After the tags and policy are created, apply the policy to every mailbox in a specific database using this command...

Get-Mailbox -Database "DatabaseName" | Set-Mailbox -RetentionPolicy "PolicyName"

Open in new window


Hope this helps.
0
 
LVL 5

Expert Comment

by:bobluis
ID: 41784481
Search-Mailbox -Identity "Nam_of_mailbox" -DeleteContent -Force

Open in new window


Before executing the command make sure you've exported all the mail content, once the command executes it will delete all the items, so use with caution.
0
 
LVL 16

Expert Comment

by:Todd Nelson
ID: 41813582
You should have enough information to provide you with a solution.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
This article outlines some of the reasons why an email message gets flagged as spam on a recipient's end.
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question