I would like to export content from some Exchange 2010 sp2 mailboxes into PSTs over 1yr old and delete the content in the mailbox

I would like to export email from some Exchange 2010 sp2 mailboxes into PSTs over 1yr old and delete the content in the mailbox

Can you suggest script or other method using Exchange
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ChrisSenior Technical ArchitectCommented:
you can use the standard exchange functionality to do this


The example you want is

Search-Mailbox -Identity "April Stewart" -SearchQuery "Subject:'Your bank statement'" -DeleteContent

if you have a large set of users then you can put together a CSV list and a for each loop - something like the following, but i havne't tested that so the syntax might be slightly off

$csv = import-csv "pathtocsv
$list = $csv
Foreach ($user in $list)
{Search-Mailbox -Identity $_.mailbox -SearchQuery "Subject:'Your bank statement'" -DeleteContent}

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JackShukerTechnicalAuthor Commented:
Hello Chris

I am looking to  export and delete all items over a certain age for some users
I am told that the delete Content syntax does not work on Exchange 2010 SP2

Can you confirm


ChrisSenior Technical ArchitectCommented:
its been a while since i have used a 2010 SP2 system but it should work fine, quick check on the technet forum gave one obvious result but that was permissions and syntax related


try it out and see if it works
ChrisSenior Technical ArchitectCommented:
only solution posted and no feedback to say it doesn't work
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.