Exchange 2010 Script Needed to Delete Mail Older than 120 days

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.

Who is Participating?
suriyaehnopConnect With a Mentor Commented:
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"
fireguy1125Author Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.