How to? Exchange 2007, Search a keyword through multiple mailboxes
I need some help with something. We have exchange 2007 running on windows 2003 R2. I need to search 50 users mailboxes and search for a keyword in the body of the email from a specific date and extract the e-mails that include this keyword from those 50 mailboxes. I have researched this and the only thing I was able to find was it would search the whole database... which is not what we want. We just want to search 50 specific mailboxes. Any input would be appreciated. Thanks
June 19th, 2012 6:32pm

You can use the Export-Mailbox cmdlet. First create a CSV file with this format--the first line is as shown and the rest are the names of the mailboxes to be searched. Name Harry Potter Hermione Granger Ron Weasley Then you can write a script of this form. $Names = Import-CSV -Path C:\Names.csv ForEach ($Name in $Names) { Export-Mailbox -Identity $Name -AllContentKeywords "Fudge" -ReportFile C:\BadWords.xml -PSTFolderPath C:\ExportedStuff.pst } This is just an example; there are a lot of options for the Export-Mailbox cmdlet. You can read more here: http://technet.microsoft.com/en-us/library/aa998579(v=exchg.80).aspx http://blogs.technet.com/b/exchange/archive/2006/12/18/3397563.aspx Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
Free Windows Admin Tool Kit Click here and download it now
June 19th, 2012 7:40pm

You can use the Export-Mailbox cmdlet. First create a CSV file with this format--the first line is as shown and the rest are the names of the mailboxes to be searched. Name Harry Potter Hermione Granger Ron Weasley Then you can write a script of this form. $Names = Import-CSV -Path C:\Names.csv ForEach ($Name in $Names) { Export-Mailbox -Identity $Name -AllContentKeywords "Fudge" -ReportFile C:\BadWords.xml -PSTFolderPath C:\ExportedStuff.pst } This is just an example; there are a lot of options for the Export-Mailbox cmdlet. You can read more here: http://technet.microsoft.com/en-us/library/aa998579(v=exchg.80).aspx http://blogs.technet.com/b/exchange/archive/2006/12/18/3397563.aspx Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
June 19th, 2012 7:49pm

You can use the Export-Mailbox cmdlet. First create a CSV file with this format--the first line is as shown and the rest are the names of the mailboxes to be searched. Name Harry Potter Hermione Granger Ron Weasley Then you can write a script of this form. $Names = Import-CSV -Path C:\Names.csv ForEach ($Name in $Names) { Export-Mailbox -Identity $Name -AllContentKeywords "Fudge" -ReportFile C:\BadWords.xml -PSTFolderPath C:\ExportedStuff.pst } This is just an example; there are a lot of options for the Export-Mailbox cmdlet. You can read more here: http://technet.microsoft.com/en-us/library/aa998579(v=exchg.80).aspx http://blogs.technet.com/b/exchange/archive/2006/12/18/3397563.aspx Ed Crowley MVP "There are seldom good technological solutions to behavioral problems." Thanks, but is there any way to just run a command in the exchange power shell? And where do we specifiy the mailbox name? I am assuming the $name would be the mailbox? Thanks for your help.
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2012 2:25pm

And where do we specifiy the mailbox name? I am assuming the $name would be the mailbox? Hi Qais, As Ed said, you can create a csv file and list the mailboxes name into it, e.g. C:\name.csv, the file format is: Name Harry Potter Hermione Granger Ron Weasley .... If you just want to run a command, please refer to the Scenario 1 in the following link provide by Ed as well: http://blogs.technet.com/b/exchange/archive/2006/12/18/3397563.aspx get-mailbox Database DB1 | Export-Mailbox SubjectKeywords "Discovery Keywords" TargetMailbox Administrator TargetFolder 'MyData' You can modify the Get-Mailbox to filter 50 mailboxes which you want to search. For example: Get-Mailbox -Filter {CustomAttribute1 -eq "abc"} | Export-mailbox...Frank Wang TechNet Community Support
June 21st, 2012 2:20am

And where do we specifiy the mailbox name? I am assuming the $name would be the mailbox? Hi Qais, As Ed said, you can create a csv file and list the mailboxes name into it, e.g. C:\name.csv, the file format is: Name Harry Potter Hermione Granger Ron Weasley .... If you just want to run a command, please refer to the Scenario 1 in the following link provide by Ed as well: http://blogs.technet.com/b/exchange/archive/2006/12/18/3397563.aspx get-mailbox Database DB1 | Export-Mailbox SubjectKeywords "Discovery Keywords" TargetMailbox Administrator TargetFolder 'MyData' You can modify the Get-Mailbox to filter 50 mailboxes which you want to search. For example: Get-Mailbox -Filter {CustomAttribute1 -eq "abc"} | Export-mailbox...Frank Wang TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
June 21st, 2012 2:29am

Hi, Any updates?Frank Wang TechNet Community Support
June 24th, 2012 10:00pm

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

Other recent topics Other recent topics