logo
search
Compliance Problems

Fix PowerShell Purge Parameter Not Recognized in Microsoft 365

Partner EditorPartner Editor Sep 28, 2026 869 views

Question details

The user is unable to execute the New-ComplianceSearchAction command with the -Purge parameter in Microsoft 365 PowerShell.

How to Fix PowerShell Purge Parameter Not Recognized in Compliance Search
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.
Before you start

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.

Solution 1Recommended

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.

1
Check Role Groups in Purview

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).

2
Update PowerShell Module

Open PowerShell as an Administrator and run the command 'Update-Module -Name ExchangeOnlineManagement' to ensure you are using the latest module version.

3
Reconnect to Security & Compliance

Run 'Connect-IPPSSession' to properly authenticate specifically to the Security & Compliance center where the compliance search commands and parameters are hosted.

Verify Microsoft Purview Permissions and PowerShell Modules
Caution with Purge Actions: Never run purge actions without strictly confirming the search scope and deletion requirements, as purged data may be permanently unrecoverable.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS website and click the 'Download WPS Office Free' button.
  2. 2. Install WPS Office: Run the downloaded installer and follow the simple on-screen instructions to set up the software.
  3. 3. Open Your Files: Launch WPS Office and directly open your existing Word, Excel, or PowerPoint files to continue working seamlessly.
Fully compatible with Microsoft Office formats (.docx, .xlsx, .pptx) for seamless file sharing.Lightweight installation that won't bog down your system's performance or require complex setups.Familiar, user-friendly interface requiring zero learning curve for Microsoft Office users.Built-in PDF toolkit for fast document conversion, editing, and annotation.
microsoft office alternative - wps office

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.