I ran a command to search a mailbox with -estimateresultonly it found 30 documents
(replaced mailbox with XXXXX..... for the posting of script)
[PS] C:\>search-mailbox -identity 'XXXXXXXXXXXXXXXXXX' -searchquery 'from:"heat.escalation@blood.ca"' -estimateresultonly
RunspaceId : cea1cf4c-3d9e-4dae-ad85-8e7111966d33
Identity : internal.bloodservices.ca/CBS Client Management/REGIONS/CENTRAL/USERS/XXXXXXXXXXXX
DisplayName : XXXXXXXXXXXXXX
TargetMailbox :
TargetPSTFile :
Success : True
TargetFolder :
ResultItemsCount : 30
ResultItemsSize : 145.8 KB (149,278 bytes)
I ran a second command to delete those documents and got a positional parameter error.
I want to delete those 30 documents but i don't understand why i got the error
[PS] C:\>search-mailbox -identity 'XXXXXXXXXXXXXX' -searchquery 'from:"heat.escalation@blood.ca"' -deletecontent
A positional parameter cannot be found that accepts argument '-deletecontent'.
+ CategoryInfo : InvalidArgument: (:) [Search-Mailbox], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Search-Mailbox
Can someone help with script and explain the error ? Many thanks