Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Exchange: Batch searching with EMS.

Posted on 2015-01-20
3
Medium Priority
?
46 Views
Last Modified: 2015-02-01
I have multiple Exchange Servers and I need to search for specific keywords across emails and attachments.  I would like to use EMS and a batch file to perform this.

Does anyone know if this is possible, and if so if you could provide some examples?  The output that I am looking for is a listing of every item in exchange that is responsive to the keywords.

This is for Exchange 2010.
0
Comment
Question by:rye004
3 Comments
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 2000 total points
ID: 40561017
You can use the following script below to accomplish this.

NOTE: before running the script you need to run the command below...
New-ManagementRoleAssignment -Role "Mailbox Import Export" -SecurityGroup "YourSecurityGroupName"


This script will find all of the users in your domain and export each mailbox in its own PST file with any of the contents you are looking for.
$Mailbox = Get-Mailbox -ResultSize Unlimited
Foreach ($user in $Mailbox) {
New-MailboxExportRequest -Mailbox $user -ContentFilter {(body -like "*your txt here*")} -FilePath "\\SERVER\ShareName\$user.pst
}

Open in new window


Will.
0
 
LVL 3

Expert Comment

by:Rezwan Islam
ID: 40561287
You can try to do an exchange discovery search on all mailboxes via ECP or using the following on EMS. Make sure you have got the discovery management role group permission first (get-rolegroupmember -identity "Discovery Management").

New-MailboxSearch -Name "name this search" -StartDate "mm/dd/yyyy" -EndDate "mm/dd/yyyy" -TargetMailbox "target mailbox name" -SearchQuery '"content 1" and "content 2"' -MessageTypes Email -IncludeUnsearchableItems -LogLevel Full

This will create a search folder on the target mailbox and run a search against all mailboxes in your domain.

Ref: https://technet.microsoft.com/en-us/library/dd353189(v=exchg.141).aspx
0
 

Author Closing Comment

by:rye004
ID: 40583351
Thank you so much!
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question