Solved

EX2010 SP1 - Deleting a Message using EMS

Posted on 2012-03-27
3
720 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

707 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