Excluding attachments with sever-wide search across all email boxes in Exchange Server

KristinB 101 Reputation points
2020-08-29T00:55:11.297+00:00

I need to search emails in an exchange account but I only want to search for the terms in the body of the email. If the body of the email does not include the search terms but an attachment does, I do not want the email pulled in the search. The search I used that is not working is (body:"key phrase") OR (body:"keyword1" AND body:"keyword2") but still get emails with none of the terms in the body of the email, only in the attachment.

Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,039 questions
0 comments No comments
{count} votes

Accepted answer
  1. KristinB 101 Reputation points
    2020-08-31T21:22:13.703+00:00

    I am performing an organization-wide search as an admin.

    However, your response was immensely helpful because I then exported and downloaded those results, opened the downloaded results into my Outlook client and using the search tool, I entered the following in both the "Body" and "Subject" fields:

    ("keyphrase") OR ("keyword1" AND "keyword2"). The search looks like this in the search bar:

    contents:( "keypharse" OR "keyword1" AND "keyword2" ) subject:( keypharse" OR "keyword1" AND "keyword2" )

    I entered "OR" before "subject" and it seems to have worked.

    Thank you!

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Yuki Sun-MSFT 40,931 Reputation points
    2020-08-31T08:56:49.93+00:00

    Are you performing an organization-wide search as an administrator using Powershell scripts like Search-Mailbox or New-MailboxSearch? If this describes your situation, I am afraid it's not feasible to exclude the attachment contents. This is by design.

    Here is a similar thread for your reference: Search-Mailbox - Don't search attachments.

    If you are just searching within the Outlook client, you can try specify the attachment field with the NOT statement:
    "keywords" NOT attachment:"keywords"


    If the response is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments