Deleting content or messages from Exchange mailboxes


 

Sometimes you may have a email or message that needs to be removed / deleted from all mailboxes on exchange based on eith keywords or subjects.

The following should give you an idea of the scripting needed

 

Get-Mailbox | Export-Mailbox -SubjectKeywords "test" -TargetFolder "recover" -TargetMailbox Administrator -DeleteContent -Confirm:$false

Get-mailbox -database 'DB1' | export-mailbox -ContentKeywords "virus" -TargetFolder "VirusMessages" -TargetMailbox Administrator -DeleteContent

Get-mailbox -database 'DB1' | export-mailbox �AttachmentFilenames "movie" -TargetFolder "MovieAttachmentData" -TargetMailbox Administrator -DeleteContent 

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.