Powershell - Delete message from All mailboxes.
I need a powershell script that will delete a specific e-mail from all mailboxes based on subject. Here is the script I came up with. Get-Mailbox -resultsize unlimited | Export-Mailbox -SubjectKeywords "junk" -Deletecontent -confirm:$falseI have additional requirements I am trying to figure out.I want to delete the message from all mailboxes except for 3 specific users.I also notice that the script will put the deleted message in the "Mailbox Dumpster" in each users mailbox, so the user can recover the message if they want to .Is there a way to purge the message from their dumpster so they cant recover it?
February 5th, 2010 2:05am

Put some attribute to those three users and then get-mailbox where user doesn't have those attributes.... which will return all the mailboxes which doesn't have those attribute and then disable the dumpster on exchange server.Arun Kumar | MCSE - 2K3 + Messaging | ITIL-F V3
Free Windows Admin Tool Kit Click here and download it now
February 5th, 2010 2:19am

Disable the dumpster on the exchange server? For all users?
February 5th, 2010 4:22am

The dumpster is disabled on the store level Deleted item retention is disabled for mailbox storeJames Luo TechNet Subscriber Support (http://technet.microsoft.com/en-us/subscriptions/ms788697.aspx) If you have any feedback on our support, please contact tngfb@microsoft.com
Free Windows Admin Tool Kit Click here and download it now
February 16th, 2010 8:33am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics