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:
- Basic search and delete.
- Search, delete and export results.
- Search and export to a mailbox with logs.
Here is a run through the Search and Delete Messages script:
- 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.
- 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.
- 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