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

Powershell script to find all messages containing keyword.

Hi All,

I've been trying to write a powershell script for our Exchange 2007 server that has around 300 mailboxes. We occassionally have a requirement based upon the freedom of information act to disclose to a customer all of the information we hold electronically about them.

What I am trying to achieve is a method of searching across all mailboxes for a particular keyword "e.g. *Mr Smith*" contained within the email, and then to export this to a PST file.

I've been playing with Export-Mailbox and -PSTFolderPath methods, but I just keep going round in circles.

Does anyone know if this is possible? If not possible across the entire mailbox database, is there a script that would work on a single mailbox?

Best wishes
Steve


0
callflowsolutions
Asked:
callflowsolutions
  • 2
1 Solution
 
AkhaterCommented:
0
 
AkhaterCommented:
Sorry for the link only approach but I was leaving.

The above link will show you how to do what you want and export the result to another mailbox. It shld be easy to change it to a pst.

Will be back in a few hours.

0
 
callflowsolutionsAuthor Commented:
Hi Akhater,

Excellent stuff. Thanks very much for the quick response. I was able to quickly combine the two commands to get what I wanted.

"get-mailbox - Database "Mailbox Database" | Export-Mailbox ContentKeywords "MySearchData" TargetMailbox Administrator TargetFolder 'COPYOFEMAILS'

Thanks again!
Steve
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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