Solved

Exchange 2010 Script Needed to Delete Mail Older than 120 days

Posted on 2014-04-04
3
2,892 Views
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.

Thanks
0
Comment
Question by:fireguy1125
[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
3 Comments
 
LVL 8

Expert Comment

by:EEhotline
ID: 39978616
0
 
LVL 1

Author Comment

by:fireguy1125
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.
0
 
LVL 19

Accepted Solution

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

http://social.technet.microsoft.com/Forums/exchange/en-US/581ea5df-0e65-47ea-8efd-aa67e27c0320/powershell-script-that-deletes-email-older-than-x-days-with-a-specific-subject-line-exchange?forum=exchange2010

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

Open in new window


However, Search Query doesn't contained "Received"

http://technet.microsoft.com/en-us/library/bb232132(v=exchg.141).aspx

http://social.technet.microsoft.com/Forums/exchange/en-US/2613d675-449b-47b5-a584-b8a6a1eca665/searchmailbox-searchquery-options?forum=exchange2010
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…

730 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