i used the below commend to delete specific email sent from HR by error to all staff
Get-Mailbox -server XXXX -ResultSize 9999 | Where-Object {$_.HiddenFromAddressListsEnabled -eq $false} | Search-Mailbox -SearchQuery '{Subject:"* Pay Advice For Period Jul-2019*"} and {from:HR@XXXX} and {Received: 25/07/2019}'–DeleteContent
the command filer not work properly and deleted 10000 mailboxes from all users which has critical data
two questions here
1. how to recover these mails (no old backups available)
2. what is the error in the query so that it retried items out of its scope
Mahmoud Sabry IT System Engineer