Delete an email with a specific subject from all mailboxes

Administrators can use the Search-Mailbox cmdlet to search user mailboxes and then delete messages from a mailbox.

To search and delete messages in one step, run the Search-Mailbox cmdlet with the DeleteContent switch. However, when you do this, you can’t preview search results or generate a log of messages that will be returned by the search, and you may inadvertently delete messages that you didn’t intend to.

See the below example:

Get-MailBox | Search-Mailbox -SearchQuery 'Subject:"COMPANY SALARY UPDATE - OCT 2016"' -DeleteContent

Imagine an email send from HR department with subject “COMPANY SALARY UPDATE – OCT 2016” & to entire team or a group mail Id or many peoples and that having some wrong details. An IT. administrator can delete this mail by running the above script by using the exchange power shell easily.

Reference: https://docs.microsoft.com/en-us/office365/securitycompliance/search-for-and-delete-messagesadmin-help

Related posts

Moving all Arbitration mailboxes to new database

by Jimmy
6 years ago

Delete all contacts & contact groups from a Lync-2010 User

by Jimmy
13 years ago

Account Pictures from Active Directory (UserTile8 for Windows 8/8.1), Trouble shooting points

by Jimmy
11 years ago
Exit mobile version