A parameter cannot be found that matches parameter name 'Purge'

Eduardo Martín Sanz 41 Reputation points
2022-03-11T09:57:42.223+00:00

Good morning:

I am trying to do a mail deletion using the following command:

New-ComplianceSearchAction -SearchName "+++++" -Purge -PurgeType HardDelete

and when I run it I get the following message:

A parameter cannot be found that matches parameter name 'Purge'.

  • CategoryInfo : InvalidArgument: (:) [New-ComplianceSearchAction], ParameterBindingException
  • FullyQualifiedErrorId : NamedParameterNotFound,New-ComplianceSearchAction
  • PSComputerName : eur01b.ps.compliance.protection.outlook.com

I have checked permissions and my user is inside the Organization Manager group in exchange.

The truth is that I don't know what else to look at, I don't know if I'm missing some kind of permissions, it's a problem of the command or the module.

Is there anyone who had the same problem and solved it?

Thanks

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,793 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 113.8K Reputation points MVP
    2022-03-11T10:15:19.05+00:00

    Organization management by default does not include permissions for this. You need to have the "Mailbox Search" role assigned, which by default is only available under Discovery Management.

    As a tip, in order to find which specific role you need for any given cmdlet, use the following:

    Get-ManagementRole -Cmdlet New-ComplianceSearchAction -CmdletParameters Purge
    

2 additional answers

Sort by: Most helpful
  1. Joyce Shen - MSFT 16,691 Reputation points
    2022-03-14T02:40:58.157+00:00

    Hi anonymous user

    Is there any progress here about this issue so far? We can learn from the official document that:

    To create and run a Content search, you have to be a member of the eDiscovery Manager role group or be assigned the Compliance Search role in the Microsoft 365 compliance center. To delete messages, you have to be a member of the Organization Management role group or be assigned the Search And Purge role in the compliance center For information about adding users to a role group, see Assign eDiscovery permissions.

    New-ComplianceSearchAction -Purge Parameter cant be found.


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    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.

    1 person found this answer helpful.

  2. Eduardo Martín Sanz 41 Reputation points
    2022-03-14T07:37:34.573+00:00

    Good morning:

    Well as you have helped me well, the problem is a permissions issue, a colleague of mine who has directly assigned the Mailbox Search permission, has been able to execute the sentence without problems, so we will have to review the permissions assigned to my user, it seems that for some reason, belonging to a group with such permissions (roles) assigned is not being effective in my account.

    Thank you all for your help

    Regards

    0 comments No comments

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.