Search and Delete Message

Syed Khairuddin 60 Reputation points
2023-08-10T15:07:43.1166667+00:00

Hello,

I would like to search and delete a message in my exchange 2013 server for a particular user with the specific subject. I have gone though

https://learn.microsoft.com/en-us/exchange/search-for-and-delete-messages-exchange-2013-help

When I run the below command on exchange 2013 shell I this error.

Search-Mailbox -Identity "syed" -SearchQuery 'Subject:"Your bank statement"' -TargetMailbox administrator -TargetFolder "SearchAndDeleteLog" -LogOnly -LogLevel Full


WARNING: The Search-Mailbox cmdlet returns up to 10000 results per mailbox if a search query is specified. To return
more than 10000 results, use the New-MailboxSearch cmdlet or the In-Place eDiscovery & Hold console in the Exchange
Administration Center.
Cannot save changes made to an item to store.
    + CategoryInfo          : InvalidArgument: (:) [], QuotaExceededException
    + FullyQualifiedErrorId : [Server=HQ-DED-EXCH01,RequestId=ae6de6f8-2568-49d9-ab56-e42d6fcb1385,TimeStamp=8/10/2023
    2:56:49 PM] [FailureCategory=Cmdlet-QuotaExceededException] 5B9F9394


Your help will be appreciated.

Exchange | Exchange Server | Other
Exchange | Exchange Server | Management
{count} votes

Accepted answer
  1. Kael Yao 37,746 Reputation points Moderator
    2023-08-11T02:24:25.1166667+00:00

    Hi @Syed Khairuddin

    According to the error message QuotaExceededException, the cause may probably be the target mailbox (administrator) has reached its quota.

    Please have a check of the mailbox usage.

    If this is not the case, please change the target mailbox to another mailbox and see if the issue persists.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. skak 21 Reputation points
    2023-08-11T16:39:30.9466667+00:00

    Yes this can be true. how did you came to know that's it's quota issue? As the error never mentioned Quota Warning ⚠️

    0 comments No comments

  2. Syed Khairuddin 60 Reputation points
    2023-08-13T10:56:57.3366667+00:00

    Can you let me know how to remove the search and delete the message from a Single database as I have 10 databases in my exchange server . I would like to delete the message from a single database.


  3. Syed Khairuddin 60 Reputation points
    2023-08-14T06:53:12.1433333+00:00

    When I run the below command I get the below message.

    [PS] C:>Get-Mailbox -Database "HrDatabase" | where{$_.Name -eq "Inbox"} | Search-Mailbox -SearchQuery 'Subject:"Annual_Leave Compliance for 2023"' -DeleteContent

    WARNING: The Search-Mailbox cmdlet returns up to 10000 results per mailbox if a search query is specified. To return

    more than 10000 results, use the New-MailboxSearch cmdlet or the In-Place eDiscovery & Hold console in the Exchange

    Administration Center.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.