Problem with Search-Mailbox Query

Status
Not open for further replies.
V

Veichtlbauer

I want to perform a rather simple task in user's mailboxes: deleting all messages received before a certain date. This is on Ex2010 SP1, and as per documentation, the search string is in Advanced Query Syntax .

Search-Mailbox -Identity " user" -SearchQuery " received:<01/01/2010" -DeleteContent

When I run that command, however, I get an error message as follows:
+ CategoryInfo : InvalidArgument: :)) [], ParserException
+ FullyQualifiedErrorId : 339B33A9

What am I doing wrong here, I don't quite understand? Followed the reference to E-Mail properties here: http://www.microsoft.com/windows/products/winfamily/desktopsearch/technicalresources/advquery.mspx, and the Search-Mailbox docs here: http://technet.microsoft.com/en-us/library/dd298173.aspx.
 
V

Veichtlbauer

Yes, that role is assigned to the account. If I execute the command without the -SearchQuery parameter, it executes just fine. The problem indeed seems to be the AQS string " received:<01/01/2010" , in particular the colon. When I remove the colon, I get an error that the " less then" operator must not be used in conjunction with a keyword. If I remove that operator as well, the command returns no error, but doesn't actually do what I want it to (rather obviously).
 
F

Frank.Wang

Hi Veichtlbauer,

I test it in lab and it works.

First, I test Search-Mailbox -Identity " user" -SearchQuery " received:01/01/2010" -DeleteContent

And the mails received on 01/01/2010 will be deleted.

Then I test Search-Mailbox -Identity " user" -SearchQuery " received:<01/01/2010" -DeleteContent

The mails received before 01/01/2010 will be deleted.

From your description:" If I remove that operator as well, the command returns no error, but doesn't actually do what I want it to"

Do you mean the mails you received on 01/01/2010 has been deleted?

What " Region and Language" do you set?

Frank Wang
 
V

Veichtlbauer

Hmm, then something about my setup must be wrong then? I used the exact same syntax as you, and it resulted in the error:

Das Eigenschaftsschl&uuml;sselwort wird nicht unterst&uuml;tzt.
+ CategoryInfo : InvalidArgument: :)) [], ParserException
+ FullyQualifiedErrorId : 3241D4D1

To clarify:

When I use the syntax below, I get no error message, the mailbox gets searched, but no elements are deleted (that ought to be because the search criteria are not very logical...):

Search-Mailbox -Identity g.veichtlbauer -SearchQuery " received 01.01.2010" -DeleteContent

The server is using German (Austria) locale, but it doesn't work even when I use the German date format. Somehow it does not seem to like the colon in the AQS though...
 
F

Frank.Wang

Hi Veichtlbauer,

According to the error message: " Das Eigenschaftsschl&uuml;sselwort wird nicht unterst&uuml;tzt." ->The property keyword isn't supported.

The error will be occur if you enter a wrong(unsupported) property.

Did you try other properties, e.g: From, Subject...

Details: Understanding Exchange Search

http://technet.microsoft.com/en-us/library/bb232132.aspx

My lab is English(US) format. Sorry I haven't a German language Exchange to test.

Frank Wang
 
V

Veichtlbauer

Argh! I wasn't aware that the search string is completely localized, even the keywords!

So this one works just fine:

Search-Mailbox -Identity " user" -SearchQuery " empfangen:<01.01.2010" -DeleteContent

Thanks for hinting in the right direction, I am so blind :)
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
W Outlook 2016 search problem persists after applying all known solutions Using Outlook 12
D Icloud Outlook 2010 Task/Reminder Search Problem Using Outlook 1
W Microsoft Outlook 2010 Instant Search Encountered a Problem While Trying to Display Results. Using Outlook 1
C Problem with Free/Busy search of an Exchange user from GroupWise Exchange Server Administration 5
P Problem with a Search-Object resulting from an AdvancedSearch Outlook VBA and Custom Forms 2
M Outlook 2010 Problem with OutLook 2010 32 bit, after Windows Auto Update Using Outlook 3
Marc2019 Outlook 2016 Font Problem Using Outlook 5
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
D Problem with custom form including _DocSiteControl1 Outlook VBA and Custom Forms 0
D Sort Problem with Sent Folders Using Outlook 1
S Conditional formatting problem with "is not empty" and categories Using Outlook 2
Mark Foley The upload of "Calendar" failed. There was a problem with the request. Using Outlook 6
avant-guvnor Import csv problem Using Outlook 7
katehawkins Outlook 2013 Ost to pst conversion problem Using Outlook 1
AbbieWhite The problem with a fairly large file. Using Outlook 3
I Outlook 2013 Send problem - 'Not Responding' forever Using Outlook.com accounts in Outlook 10
EmelineGueguen Help to understand the problem of work Using Outlook 1
S problem with convert Using Outlook 1
S SendFromAccount - Problem trying to test existing value in open email Outlook VBA and Custom Forms 2
DruinaBiscardi unexpected problem in outlook Using Outlook 1
V Outlook 2003 problem with Windows 10 Creators Update 1709 Using Outlook 0
G Windows Update Causes BCM Database Access Problem? BCM (Business Contact Manager) 4
Grimev66 problem with conversion ost to pst Using Outlook 2
R Problem with searching public folders Exchange 2013/16 Exchange Server Administration 2
J Problem with Outlook 2016 new mail tray icon alert (envelope in the systems tray) Using Outlook.com accounts in Outlook 0
S Problem running Command button code Outlook VBA and Custom Forms 2
A .ost file problem Using Outlook 4
G PROBLEM REGARDING OUTLOOK STORAGE LANGUAGES Using Outlook 4
PetraTech Odd Folder View Problem Using Outlook 3
V iCloud problem Using Outlook 9
D Reply Problem with Outlook.com account Using Outlook.com accounts in Outlook 0
MattC Problem with Outlook 2007 & iCloud / duplicate tasks Using Outlook 1
V Problem moving folders Using Outlook 4
C Problem tracking meeting responses Using Outlook 3
Mark Foley Problem subscribing to shared calendar Using Outlook 1
K Problem with FreeBusy (before 1pm only) Outlook VBA and Custom Forms 7
skylark53 Advanced recurrence problem Using Outlook 2
E RSS export as OPML problem Using Outlook 4
D outlook 2013 contact list problem Using Outlook 0
T Problem with .Recipients.Add("alias") Outlook VBA and Custom Forms 3
P Problem with Outlook 2013 Attachments Using Outlook 4
E Outlook 2007: Problem with "Move to Folder >" button on toolbar Using Outlook 6
D No problem ... at this minute, just thanking you for your help. Using Outlook 1
T Random problem in VBA macro Outlook VBA and Custom Forms 6
R Outlook won't run except in Safe mode problem Using Outlook 5
J outlook 2010 delegation problem Using Outlook 3
B Problem with import Excel BCM (Business Contact Manager) 1
chupacabra Problem with IMAP .pst file Using Outlook 13
Similar threads


















































Top