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?
 
ChrisCommented:
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
 
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
 
ChrisCommented:
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
 
ChrisCommented:
only solution posted and no feedback to say it doesn't work
0
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.