Link to home
Start Free TrialLog in
Avatar of colmisdiv
colmisdiv

asked on

Mass delete email

We are looking for a way to mass remove an email, sent in error, whether it is read or not. We are not looking for a recall.
We are running exchange 2010 sp3 rollup 7 on server 2008R2
Avatar of becraig
becraig
Flag of United States of America image

#give yourself the required permissions first
Get-Mailbox -ResultSize unlimited | Add-MailboxPermission -User MyAdmin -AccessRights FullAccess -InheritanceType all


#Then do the delete
#  -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs   These fields are expecting that you have a mailbox and folder where you move the mail before deleting you can remove these
Get-Mailbox  -ResultSize Unlimited | Export-Mailbox -SubjectKeywords "Your email subject" -IncludeFolders "\Inbox" -StartDate "11/24/2014" -EndDate "11/25/2014" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs -Confirm:$false

Open in new window



More info on message deletion:
http://blogs.technet.com/b/exchange/archive/2010/10/27/3411398.aspx
ASKER CERTIFIED SOLUTION
Avatar of becraig
becraig
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial