We had to delete a particular email from some mailboxes. Worked fine -- we used the list of people who received the email cause it was only, like 100, and did a search-mailbox like this:
get-mailbox useridxx | search-mailbox -searchquery 'Subject: "BLAH BLAH BLAH"' -targetmailbox "resultmailbox" -targetfolder "searchfolder" -loglevel full -deletecontent -Force:$True
worked fine, but we got 100 separate CSV's into the targetmailbox, and it did make accounting a little tricky.
But if I don't have a list (or it's too big) I figured I could pipe "get-mailbox" into the search-mailbox cmdlet -- with the also happy result of having one CSV with results in my targetmailbox. However, I hit some kind of limit and I can't figure
out what it is.
Here's the command I used:
get-mailbox -server stmail3.muad.local -resultsize unlimited | search-mailbox -searchquery 'Subject: "yada yada yada"' -targetmailbox "resultmailbox" -targetfolder "new-folder" -loglevel full -logonly -Force:$True
and here's the error I got:
Cannot open attachment.
+ CategoryInfo : InvalidArgument: (:) [], AttachmentExceededException
+ FullyQualifiedErrorId : 727EA773
I made sure the targetmailbox didn't have a quota.. but now I'm out of ideas. I do not get this error with -loglevel basic, but what if I need the csv output to report on how many were found and/or deleted?
What am I missing?
Thanks for any hints.