These are the directions that I used:
https://www.petri.com/delete-email-from-microsoft-exchange-user-mailboxes-using-powershell
Step 1: Search for the email
You need to know the subject of the email. This command will create a report and copy the email to a mailbox. I did it to my own mailbox, into a sub-folder that I could delete after.Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Your Query ' -TargetMailbox "Search Mailbox Name" -TargetFolder "Your Target folder"
Step 2: Delete the email from one user
You want to make sure your command works, and that it doesn't wipe out every email. Test it on one user that you know got it.Search-Mailbox -Identity "username or alias" -SearchQuery 'Subject:" Your query "' -DeleteContent
Step 3: Delete from all users
If you're satisfied with your test in step 2, use this PowerShell command to delete the email from all usersGet-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Your query"' –DeleteContent
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.