Monday, August 26, 2013

How to Bulk Delete Email Content in Organization Wide Mailboxes Using Subject Line

Hi Folks,

Today I had very interesting thing in Exchange 2010 in terms of Search-Mailbox, So I thought to share with you.

Issue: -

User initiated test bulk emails from application to multiple users from Internal and External and user wants to delete those test emails from all user mailboxes that are received.

Error Statement: -

We can remove/delete those emails in below scenarios,

1. Virus Infected emails.

2. Confidential Email sent wrongly.

3. Need to remove an Email with Specific subject from all the mailboxes in the organization.


Permission: -

In Exchange 2007 & 2010 Microsoft introduced RBAC which is Roll Base Access Control based on Team access, competency level.


Resolution: -


     1.  You need to assign Discovery Management Roll Permission prior to Run the Report.

   
    2. Select the User and Give OK







3. Add Administrator account to Mailbox Export Import Role Group.



4. Now Before Deleting in Bulk , We can use a log only switch to verify how many Mails we are going to delete and to verify the we are going to delete the right one.

Get-mailbox | search-mailbox –searchquery “Subject:’Ticket:Subject Line’” –Logonly –Targetmailbox administrator –Targetfolder Inbox

Now this will show how many mailboxes have this content



5. Once above Command grab the email logs and it will share the same in Administrator Mailbox as below.



6. Now we will go ahead and Delete it: -

Get-mailbox | search-mailbox –searchquery “Subject:’SubjectLine’” –DeleteContent


Thanks
Keep Visiting.