July 2017
Intermediate to advanced
648 pages
31h 9m
English
Most likely, you will need to delete items from several mailboxes in a bulk operation. The following one-liner can be used to delete messages from every mailbox in the organization:
Get-Mailbox -ResultSize Unlimited | ` Search-Mailbox -SearchQuery 'from:spammer@contoso.com' ` -DeleteContent -Force
In this example, we are piping all the mailboxes in the organization to the Search-Mailbox cmdlet. Any messages sent from the spammer@contoso.com email address will be deleted.
Read now
Unlock full access