[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

search-mailbox (need to delete an email send to entire firm)

user jjones sent and email, subject being "this is an example!"

how can i delete all messages with the subject that jjones sent? i have over 500 mailboxes.

thanks
0
ttrbrtsn
Asked:
ttrbrtsn
  • 3
  • 2
1 Solution
 
SreRajCommented:
Hi,

Please try following command.

Get-Mailbox | Search-Mailbox -SearchQuery "Subject:'this is an example!'" -TargetMailbox <Your Mailbox> -TargetFolder "SearchLog" -LogLevel Full -DeleteContent

<Your Mailbox> has to be replaced by your mailbox name.
This command will create a folder "SearchLog" in your mailbox and will store the result there.
0
 
ttrbrtsnAuthor Commented:
Will it permanently delete it from all the other mailboxes
0
 
SreRajCommented:
Yes, it will permanently delete all mails having that subject from all mailboxes in the organization.
0
 
ttrbrtsnAuthor Commented:
Very clear and to the point
0
 
ttrbrtsnAuthor Commented:
i have a .pst file. can i use the same script to find emails?
if i dont want to delete, i exclude -deletecontent
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now