Exchange 2010 powershell script

Hi Experts,

- I am domain admin of our network.
- windows exchange 2010 on server 2008R2
- running exchange management shell as administrator

I have a user that has 10's of thousands of email in his junk mail and deleted times. There are too many delete them using outlook.

I am trying to find a power shell script that will allow me to do the deleting from there.

Been searching  but not coming up with anything precise on deleting mail items only. Obviously I need to be careful so I don't to blow the mailbox away :-)

Cindy (latteandcoffee)
Who is Participating?
CESNetwork AdministratorCommented:
This should do for the deleted items:

Get-Mailbox user1 | Export-Mailbox -DeleteContent -IncludeFolders "\deleted items"

The junk folder should be similar "junk items" or something like that.

Here is a relevant KB from MS:
Amit KumarCommented:
By following above make sure you set Retention of deleted items to 0 else once recovery dumpster is full no e-mails will be deleted. Once all unwanted e-mails are deleted then change retention of deleted items.
PberSolutions ArchitectCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

-- CES (https:#a42407980)
-- Amit Kumar (https:#a42408785)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Cleanup Volunteer
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.