Fix PowerShell Purge Parameter Not Recognized in Microsoft 365
Question details
The user is unable to execute the New-ComplianceSearchAction command with the -Purge parameter in Microsoft 365 PowerShell.

- Product
- Microsoft 365 / Microsoft Purview
- Device & OS
- not provided
- Scenario
- Attempting to purge items using a compliance search action via Exchange Online PowerShell.
- Observed behavior
- The PowerShell command line rejects the -Purge parameter, indicating it is not recognized or unavailable.
Ensure you are using the latest version of the Exchange Online PowerShell module and that you have an active administrator connection to authenticate with Microsoft 365.
Verify Microsoft Purview Permissions and PowerShell Modules
Ensure your administrator account has the exact roles required to perform purge actions and that your PowerShell module is correctly connected.
The -Purge parameter will only be recognized if the authenticated account has explicit 'Search And Purge' permissions. Even Global Administrators must manually assign this role to themselves before the parameter becomes available in the PowerShell session.
Log in to the Microsoft Purview compliance portal, navigate to 'Roles & scopes', and ensure your account is assigned the 'Search And Purge' role (typically found under the eDiscovery Manager role group).
Open PowerShell as an Administrator and run the command 'Update-Module -Name ExchangeOnlineManagement' to ensure you are using the latest module version.
Run 'Connect-IPPSSession' to properly authenticate specifically to the Security & Compliance center where the compliance search commands and parameters are hosted.

Escalate to Microsoft Support via Microsoft 365 Admin Center
If permissions are correct but the parameter remains rejected, backend configurations or licensing anomalies may require Microsoft's direct intervention.
Switch to WPS Office for a Lightweight, Hassle-Free Experience
While enterprise features like Microsoft Purview require complex PowerShell configurations and strict backend management, your everyday document tasks shouldn't be that hard. WPS Office offers a free, lightweight, and incredibly intuitive alternative to Microsoft Office for creating, editing, and sharing documents, spreadsheets, and presentations without the administrative overhead.
- 1. Download the Installer: Visit the official WPS website and click the 'Download WPS Office Free' button.
- 2. Install WPS Office: Run the downloaded installer and follow the simple on-screen instructions to set up the software.
- 3. Open Your Files: Launch WPS Office and directly open your existing Word, Excel, or PowerPoint files to continue working seamlessly.

Frequently Asked Questions
Why does the New-ComplianceSearchAction command say the Purge parameter cannot be found?
This usually happens because the account executing the command lacks the 'Search And Purge' role in Microsoft Purview, or the PowerShell session was initiated with 'Connect-ExchangeOnline' instead of 'Connect-IPPSSession' which is required for compliance commands.
Can an end-user fix the missing Purge parameter in PowerShell?
No, resolving this requires a Microsoft 365 Global Administrator to assign the correct compliance roles in the Purview portal or open a support ticket with Microsoft to resolve tenant-level configuration errors.
Is the -Purge parameter available in all Microsoft 365 licenses?
The ability to search and purge email messages typically requires specific enterprise licensing, such as Microsoft 365 E5 or an appropriate compliance add-on. If your tenant lacks the required license, the parameter may not be exposed in your PowerShell session.




