• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 121
  • Last Modified:

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
0
agcsupport
Asked:
agcsupport
1 Solution
 
irweazelwallisCommented:
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now