Where am i going wrong ? powershell and pst files

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Forums Archives Forums Archives 5 years, 5 months ago.

  • Author
    Posts
  • #5627

    by ollieda1 at 2013-03-04 23:32:48

    hi all
    I used the following powershell to try and extract a date ranged PST file for sent and received items between a specific date however when I open the extracted pst it only has the folder structure and no messages.
    New-MailboxExportRequest -ContentFilter {(Received -lt '11/01/2008') -and (Received -gt '9/30/2009') -or (Sent -lt '11/01/2008') -and (Sent -gt '9/30/2009')} -Mailbox "john.smith" -Name JsmithExp -FilePath \\EX01\PST$\JS.pst
    Any ideas where i am going wrong ?
    thanks
    ollie

    by ArtB0514 at 2013-03-05 06:20:46

    You need to do some explicit grouping of your filter elements. Here's how PowerShell will process what you entered (spaces added to make grouping more visible:
    (received -lt '11/01/2008') -and ((Received -gt '9/30/2009') -or (Sent -lt '11/01/2008')) -and (Sent -gt '9/30/2009')
    What you want to enter is:
    ((Received -lt '11/01/2008') -and (Received -gt '9/30/2009')) -or ((Sent -lt '11/01/2008') -and (Sent -gt '9/30/2009'))

You must be logged in to reply to this topic.