Search and Delete Messages

From time to time, administrators need to search for and delete inappropriate or potentially harmful e-mail messages sent to multiple mailboxes across their organization. For example, e-mail messages can contain viruses or links to download a virus, inappropriate content, such as adult-related material, or confidential information that was accidentally sent to the wrong people. This is a “Search and Delete Messages” script.

The scripts contains the following command lines:

  1. Basic search and delete.
  2. Search, delete and export results.
  3. Search and export to a mailbox with logs.

Here is a run through the Search and Delete Messages script:

  1. Base search and Delete: You can search based on the subject line and and append the DeleteContent switch. Once completed, you see a log on the screen displaying which mailboxes it found the content in and how much was removed.
  2. Search, delete and export results; You can export the search results based on the subject line and move it into a target mailbox. With this method, you can see the results in the mailbox.
  3. Search and export to a mailbox with logs: This command will append the log-level switch as well and just move the content to the target mailbox or folder.

The script can be located here: Search and Delete Messages

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.