Deleting messages before a certain date


  • We use a document management system for all of our invoices (  Each site we have sends invoice to a site mailbox (EX:  Bookeeper at site1 would send a scanned invoice to

    There is an unattended pc that monitors these mailboxes for these attachments, and imports them in to the document management system.

    The message remains in the mailbox.

    On exchange, what can I do to automatically delete any message, in each maibox, dated after a year ago?  They want to retain anything before the year mark for record purposes and to make sure they were all imported.


    • Edited by rudnicke Tuesday, June 05, 2018 6:38 PM Update statement
    Tuesday, June 05, 2018 1:10 PM

All replies

  •  Ok so to clarify

    1. How long do you want to retain the items in this mailbox?
    2. I ask because you say you wanted to delete then after a year but then say you wanted to retain them for record purposes

    Couple of ways to approach this

    • Go to the PC, open outlook, sort by date and delete
    • Or if you want to retain them but not within the inbox you could create subfolders for each year and then again sort by date, highlight the desired range and MOVE them to the new folder
    • Use the Exchange Shell to search for and delete messages via the DeleteContent parameter

    Another option would be to use a 3rd party utility like DigiScope via the Search ON Find action which allows you to setup criteria such as date range, search and when an item is found you can have it Delete/Purge the items or Export to PST and then Delete/Purge etc

    Search, Recover, Export Mailboxes, Folders, Email, Contacts, Calendars, Tasks, etc. from Offline Exchange Databases (EDBs), On-Premise Exchange Servers and Office 365. Migrate/Recover direct from any offline EDB into any On-Premises Exchange Server, even cross version i.e. 2003 → 2007 → 2010 →2013 → 2016 → Office 365 with Lucid8's DigiScope

    Tuesday, June 05, 2018 6:32 PM
  • Sorry for the confusion.

    1.  Keep anything not yet a year old.

    I'm curious if retention policies would do what I need.

    Tuesday, June 05, 2018 6:40 PM
  • Hi rudnicke,

    Those steps below may be useful to you:

    1. Enable achieve for this mailbox:

    Enable-Mailbox xxx -Archive -ArchiveDatabase "Mailbox Database xxx"

    2. Create a retention tag to achieve mails from mailbox automatically:

    3. Add this retention tag to a retention policy:

    4. Apply this retention policy to this mailbox:

    Set-Mailbox xxx -RetentionPolicy "1 Year Achieve"
    Start-ManagedFolderAssistant -Identity xxx
    After that, Exchange will achieve those mails which older then 1 year to database and remove them from user's mailbox.


    Kyle Xu

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Wednesday, June 06, 2018 8:50 AM