Share via


Deleting a Specific Email from Entire Organization in Exchange 2010

There are many scenarios where we need to get rid of some Emails from the whole server

1. Virus

2.Confidential Email sent wrongly – Got to remove it

3. Need to remove a Email with Specific subject from all the mailboxes

Exchange 2010 has Good features on Searching it and Remove it .

So Will Learn how to do that.

For a User to Execute this commands , he needs specific permissions like he should be a member of Discovery Management role and he should be member of Mailbox Import Export

By Default, Administrator is not a member these roles

Use Exchange Management Shell

Replace the User Name with the Person whom you want to give access to Search and delete

Add-RoleGroupMember "Discovery Management" -Member "User Name"

Or

You can use GUI or Shell, Adding the Discovery Management Role via GUI is much easier.

http://careexchange.in/wp-content/uploads/2012/03/image_thumb12.png

Login with the Exchange Control Panel URL below -

http://careexchange.in/wp-content/uploads/2012/03/image_thumb13.png

Login with Admin Credentials -

http://careexchange.in/wp-content/uploads/2012/03/image_thumb14.png

Double Click on Discovery Management and Add Administrator as a member of Discovery Management and Save it

http://careexchange.in/wp-content/uploads/2012/03/image_thumb15.png

http://careexchange.in/wp-content/uploads/2012/03/image_thumb16.png

===============

To Add a User in Mailbox Import Export Role – Run in Exchange Management Shell

New-Managementroleassignment –Role “Mailbox Import Export” –User “Administrator”

http://careexchange.in/wp-content/uploads/2012/03/image_thumb17.png

===========

Close and Reopen the Exchange Mangement Shell – so that the new commands will start working

===========

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:’virus’” –Logonly –Targetmailbox administrator –Targetfolder Inbox

Now this will show how many mailboxes have this content

http://careexchange.in/wp-content/uploads/2012/03/image_thumb18.png

A mail will be generated to Administrators inbox with Item Count As shown below –

http://careexchange.in/wp-content/uploads/2012/03/image_thumb19.png

=======

Now we will go ahead and delete it

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

http://careexchange.in/wp-content/uploads/2012/03/image_thumb20.png

Before — From All the Mailboxes

http://careexchange.in/wp-content/uploads/2012/03/image_thumb21.png

Now its gone from All the mailboxes

http://careexchange.in/wp-content/uploads/2012/03/image_thumb22.png

Reference link -

http://technet.microsoft.com/en-us/library/dd298173.aspx

Hope it helped you to understand better !!

If you feel its too confusing – Check out the Automated Script to do these tasks for you

Discovery Search Simplified Script to Delete a Specific Email and other Tasks – Exchange 2010

Regards

Satheshwaran Manoharan