I should delete all mailboxes with a certain domain (e.g. daniele@contoso.com and not giovanni@microsoft.it) in a range of data.
The command for all the boxes should be:
foreach ($ mailbox in (get-mailbox)) {Search-Mailbox -id $ mailbox -SearchQuery '(Received: 01/01/2010..31/03/2020)' -DeleteContent -Force}
But how can I filter by domain?
The command for all the boxes should be:
foreach ($ mailbox in (get-mailbox)) {Search-Mailbox -id $ mailbox -SearchQuery '(Received: 01/01/2010..31/03/2020)' -DeleteContent -Force}
But how can I filter by domain?