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
JackShukerTechnicalAsked:
Who is Participating?

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

x
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

https://technet.microsoft.com/en-us/library/ff459253%28v=exchg.141%29.aspx?f=255&MSPPError=-2147217396

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}
0

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

Thanks

Chris
0
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

https://social.technet.microsoft.com/Forums/exchange/en-US/30a330e3-1067-43e1-b58c-bbc6a5576da8/search-for-and-delete-mail-from-all-mailboxes-in-exchange-2010-sp2?forum=exchange2010

try it out and see if it works
0
ChrisSenior Technical ArchitectCommented:
only solution posted and no feedback to say it doesn't work
0
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
Powershell

From novice to tech pro — start learning today.