?
Solved

EX2010 SP1 - Deleting a Message using EMS

Posted on 2012-03-27
3
Medium Priority
?
721 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 2000 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

770 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