get-mailbox delete content in specific OU or distribution list
Posted on 2013-10-28
hello, i am trying to delete content from multiple users mailbox.
The command i am using does so successfully for one user, however i am looking to target a specific user base and particular subject either inside an OU or inside a distribution list. So far the script i am using doesnt work. Can anyone help?
Get-Mailbox -OrganizationalUnit "ou=local" –ResultSize unlimited | Search-Mailbox -SearchQuery 'subject:*subject*' –DeleteContent
(assume the OU path is accurate)
thanks in advance