Share via

New-ComplianceSearchAction SoftDelete doesn't work

PawelT 1 Reputation point
2025-11-12T07:42:20.25+00:00

Hello

I'm trying to use New-ComplianceSearch / New-ComplianceSearchAction to quickly get rid of problematic emails, like users sending or receiving sensitive data.

On screen, everything works, no error messages, I get search results but when I finally run the command:

New-ComplianceSearchAction -SearchName "MySearch" -Purge -PurgeType SoftDelete

It just doesn't work. The action completes but emails are not deleted.

Anyone else got that problem ?

Microsoft Security | Microsoft Purview

2 answers

Sort by: Most helpful
  1. Anonymous
    2025-11-12T18:26:15.03+00:00

    Hi PawelT,
    Welcome to the Microsoft Q&A and thank you for posting your questions here.
    Coming to your question why the purge action “completes” but items remain.

    This behavior is usually expected and tied to compliance safeguards. A few common reasons:

    1. SoftDelete doesn’t erase the item -PurgeType SoftDelete moves messages to the Recoverable Items\Deletions folder, not Deleted Items. They disappear from the Inbox but remain in Recoverable Items until the retention window expires.
    2. Retention or holds override purge If the mailbox is under a retention policy, Litigation Hold, or eDiscovery hold, Purview preserves copies even after a purge. You can’t permanently remove them until the hold/policy is lifted.
    3. Built‑in purge limits PowerShell purge via New-ComplianceSearchAction only deletes up to 10 items per mailbox per action (E3/non‑Premium). For larger sets, you need multiple actions or, if you have E5, use the Graph eDiscovery purge (up to 100 items per mailbox).
    4. Permissions and case type Ensure you’re connected to Security & Compliance PowerShell and have the Search And Purge role assigned in Purview. Purge won’t work if roles are missing or if you mix classic and modern case types.

    I hope this information is helpful! If you still have questions or you come across issues, please let us know what is needed in the comments so this question can be answered.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2025-11-12T07:42:33.5966667+00:00

    If the New-ComplianceSearchAction -SearchName "MySearch" -Purge -PurgeType SoftDelete command is completing without errors but the emails are not being deleted, there are a few things to consider:

    1. Retention Policies: Ensure that there are no retention policies applied to the mailbox that might be preventing the deletion of the emails. If retention policies are in place, they may override the deletion action.
    2. Mailbox Recovery Settings: Check if single item recovery is enabled for the mailbox. If it is enabled, soft-deleted items will be retained in the Recoverable Items folder until the retention period expires.
    3. Search Validation: Make sure that the search you are running is correctly identifying the emails you intend to delete. You might want to rerun the search cmdlet to validate the results before performing the purge.
    4. Permissions: Verify that you have the necessary permissions to perform the purge action. You need to be a member of the appropriate role groups to execute these commands successfully.
    5. Execution Context: Ensure that you are connected to Security & Compliance PowerShell correctly when running the command.

    If you have checked all these factors and the issue persists, you may want to consult Microsoft support for further assistance.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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