Tuesday, 6 October 2015

Microsoft: Remove an Email from All Mailboxes by Subject

To remove an email from all the mailboxes by subject, please follow the steps below:
1. Open Exchange Management Shell

2. Type in the commands below:
Add-RoleGroupMember "Discovery Management" -Member "User Name"

* Note: Replace the User Name with the person whom you want to give access to search and delete

3. Add the user in Mailbox Import Export Role by running the commands below in Exchange Management Shell:
New-Managementroleassignment –Role "Mailbox Import Export" –User "User Name"

* Note: Replace the User Name with the person whom you want to give access to search and delete

4. Close and reopen the Exchange Mangement Shell so that the new commands will start working

5. Type in the commands below to search and delete a specific email:
Get-MailBox -resultsize unlimited | Search-Mailbox -SearchQuery "Subject:'virus'" -DeleteContent

* Note: Replace the virus with the subject of the email you would like to search and delete

6. Type in A to search and delete from all the mailboxes

No comments:

Post a Comment