NAMEWITHELD12
asked on
EX2010 SP1 - Deleting a Message using EMS
I'm trying to write an EX2010 SP1 EMS command to delete a message with the following attributes:
Rcv'd between: 3/26/2012 & 3/27/2012
Subject: blah blah
Sent to: specific user
I've tried the following but I get an error:
get-mailbox "user.name" |search-mailbox -searchquery 'subject:"blah blah"
' -StartDate "3/26/2012" -EndDate "3/27/2012" -deletecontent
The error I get:
A positional parameter cannot be found that accepts argument '3/26/2012'.
+ CategoryInfo : InvalidArgument: (:) [Search-Mailbox], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFoun d,Search-M ailbox
If I remove the -startdate and -enddate, it's successful, but it searches and deletes all messages with subject 'blah blah', which is not what I need.
Rcv'd between: 3/26/2012 & 3/27/2012
Subject: blah blah
Sent to: specific user
I've tried the following but I get an error:
get-mailbox "user.name" |search-mailbox -searchquery 'subject:"blah blah"
' -StartDate "3/26/2012" -EndDate "3/27/2012" -deletecontent
The error I get:
A positional parameter cannot be found that accepts argument '3/26/2012'.
+ CategoryInfo : InvalidArgument: (:) [Search-Mailbox], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFoun
If I remove the -startdate and -enddate, it's successful, but it searches and deletes all messages with subject 'blah blah', which is not what I need.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i don't have an exchange 2010 with me,
my guess it will take a day.
like sent:28/03/2012 (or MM/DD/YY depends on your date format)
my guess it will take a day.
like sent:28/03/2012 (or MM/DD/YY depends on your date format)
ASKER