Exchange 2010 Script Needed to Delete Mail Older than 120 days

Posted on 2014-04-04
Last Modified: 2014-04-23
I'm looking for a script for Exchange 2010 that will delete mail older than 120 days in all user mailboxes.  It would need to be something I can schedule to run on a daily basis.

Question by:fireguy1125

Expert Comment

ID: 39978616

Author Comment

ID: 39978808
I can't use retention policies, as they will apply to the archive mailbox of the users also.  Need to have a solution in which e-mail will get deleted from the mailbox, but not impact the archive mailbox.
LVL 18

Accepted Solution

suriyaehnop earned 500 total points
ID: 39981735
Try look at this, basically you have to use search-mailbox with -searchquery

Search-Mailbox -Identity "Starr, Ringo" -SearchQuery "Received:> $($Today) and Received:(Today) 

Open in new window

However, Search Query doesn't contained "Received"

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now