none
Search Criteria not applying RRS feed

  • Question

  • I am trying to run an Export-Mailbox on my entire server. That part is working. What I am having a problem with is the search conditions are not applying.

    Here is my script:

    Get-Mailbox -Server ServerName | Export-Mailbox -AllContentKeywords "First Last","First","Last","email@comany.com" -StartDate "04/02/2012" -EndDate "04/03/2012" -TargetMailbox test -TargetFolder Test

    What I am getting are emails that don't fit the search criteria, and have actually been deleted but are showing up in the exported Inbox. They don't have the Content Keywords in the subject, body or attachment, and is not inside the date range.

    Any help would be greatly appreciated. Exchange 2007 SP1

    Thanks.


    • Edited by BradKW Wednesday, April 4, 2012 3:30 PM
    Wednesday, April 4, 2012 3:29 PM

Answers

  • Hi

    Please try the command

    Get-Mailbox -Server ServerName | Export-Mailbox -allcontentkeywords (("First Last") -or ("First") -or ("Last") -or ("email@comany.com")) -StartDate "04/02/2012" -EndDate "04/03/2012" -TargetMailbox test -TargetFolder Test

    Cheers

    Zi Feng


    Zi Feng

    TechNet Community Support

    Friday, April 6, 2012 2:29 AM
    Moderator

All replies

  • I have removed all the Content Keywords except "email@company.com" And it's still pulling email it shouldn't. 
    Wednesday, April 4, 2012 4:14 PM
  • The only way I can see to troubleshoot this issue is to see some of the items that are exported.  The AllContentKeywords attribute searches every aspect of the email body, subject, or the attachment content to try and find a match.  If you are only looking for the item in the Body, use ContentKeywords that searches the Body or attachment content, or SenderKeywords for TO: field items, RecipientKeywords for FROM: field items , and SubjectKeywords for items in the Subject.

    I say all of that to say, if the email address you are using in AllContentKeywords is in a signature line or something like that in the body of the emails in the mailbox, it will match and export.

    Wednesday, April 4, 2012 8:19 PM
  • Hi

    Please try the command

    Get-Mailbox -Server ServerName | Export-Mailbox -allcontentkeywords (("First Last") -or ("First") -or ("Last") -or ("email@comany.com")) -StartDate "04/02/2012" -EndDate "04/03/2012" -TargetMailbox test -TargetFolder Test

    Cheers

    Zi Feng


    Zi Feng

    TechNet Community Support

    Friday, April 6, 2012 2:29 AM
    Moderator