Exchange 2010 delete message from multiple mailboxes

I am running the following powershell command to delete an email from multiple mailboxes. I am being prompted to confirm deleting email from mailboxes. The first mailbox is not one that showed in the search I ran using the -loglevel switch. I am guessing this is a prompt to confirm "IF" the search is matched for this mailbox confirm the delete but would like confirmation prior to confirming for that one and all of the mailboxes after.

Get-Mailbox –Database “<database>” –ResultSize unlimited | Search-Mailbox -SearchQuery 'subject:"<subject>"' -TargetMailbox "<mailbox>" -TargetFolder "<folder>" -loglevel full -deletecontent

Thank you

Ron
agcsupportAsked:
Who is Participating?
 
ChrisConnect With a Mentor Commented:
if you use the switch -logonly then you can see what its gone through and deleted

for the delete content you will get a prompt for all mailboxes unless you put a -confirm:$false
0
 
agcsupportAuthor Commented:
Perfect and that worked - Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.