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

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

by Jimmy
13 years ago

How to find the existing email forwarding configured on mail flow settings

by Jimmy
12 years ago

Clear All Event Viewer Logs

by Jimmy
7 years ago
Exit mobile version