Link to home
Start Free TrialLog in
Avatar of callflowsolutions
callflowsolutions

asked on

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


ASKER CERTIFIED SOLUTION
Avatar of Akhater
Akhater
Flag of Lebanon image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.

Avatar of callflowsolutions
callflowsolutions

ASKER

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