G
garry_h
I used to use export-mailbox every night. Now I use new-exportmailboxrequest. Fine on one level however I am unable to pass a date variable into the contentfilter option.
No matter what I do, or how I format the string, it will not evaluate the variable.
Here is roughly what I am trying to achieve
$date=(get-date).adddays(-14)
new-exportmailboxrequest -mailbox tommyt -filepath \\server\share\file.pst -contentfilter { send -gt $date }
This exports the entire mail file as opposed to the last 2 weeks
from ( get-mailboxexportrequest | get-mailboxexportrequeststatistics | fl ) I get
ContentFilter : Sent -ne $null
this is not a datetime format issue as
new-exportmailboxrequest -mailbox tommyt -filepath \\server\share\file.pst -contentfilter { send -gt '02/11/2010' }
works but
$date='02/11/2010' followed by
new-exportmailboxrequest -mailbox tommyt -filepath \\server\share\file.pst -contentfilter { send -gt $date }
does not.
Any help would be greatly appreciated
No matter what I do, or how I format the string, it will not evaluate the variable.
Here is roughly what I am trying to achieve
$date=(get-date).adddays(-14)
new-exportmailboxrequest -mailbox tommyt -filepath \\server\share\file.pst -contentfilter { send -gt $date }
This exports the entire mail file as opposed to the last 2 weeks
from ( get-mailboxexportrequest | get-mailboxexportrequeststatistics | fl ) I get
ContentFilter : Sent -ne $null
this is not a datetime format issue as
new-exportmailboxrequest -mailbox tommyt -filepath \\server\share\file.pst -contentfilter { send -gt '02/11/2010' }
works but
$date='02/11/2010' followed by
new-exportmailboxrequest -mailbox tommyt -filepath \\server\share\file.pst -contentfilter { send -gt $date }
does not.
Any help would be greatly appreciated