Get-Mailbox -Server "*SERVER*" | Search-Mailbox -TargetMailbox "*SEARCHACCOUNT*" -TargetFolder "*EMAILSDELETED*" -SearchQuery 'Subject:"*SUBJECT CONTAINS THIS*" AND Body:"*BODY CONTAINS THIS*"' -deletecontent
Get-Mailbox -Server “*SERVER*” | Search-Mailbox -SearchQuery ‘Subject:”*SUBJECT CONTAINS THIS*” Body:"*BODY CONTAINS THIS*"‘ -DeleteContent
The input object cannot be bound to any parameters for the command either because the command does not take pipeline in put or the input and its properties do not match any of the parameters that take pipeline input. + CategoryInfo : InvalidArgument: (*MAILBOXNAME*:PSObject) [Search-Mailbox], ParameterBindingException + FullyQualifiedErrorId : InputObjectNotBound,Search-Mailbox
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.