Solved

EX2010 SP1 - Deleting a Message using EMS

Posted on 2012-03-27
3
717 Views
Last Modified: 2012-06-27
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 : PositionalParameterNotFound,Search-Mailbox

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.
0
Comment
Question by:NAMEWITHELD12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
Jian An Lim earned 500 total points
ID: 37775453
you use -SearchQuery “Subject:Exchange”,”Sent:today”

or -SearchQuery “Subject:Exchange”,”Receive:today”

Or something like that, you can put sent and receive criteria but startdate and enddate is not valid command i believe.
0
 
LVL 1

Author Comment

by:NAMEWITHELD12
ID: 37776244
Are there other command variables than just today?  I ask b/c now the message was received on the 27th...
0
 
LVL 37

Expert Comment

by:Jian An Lim
ID: 37779154
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)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question