How to Exclude More Than 100 SharePoint Sites from a Retention Policy
Question details
The user needs to exclude a large number (over 100) of SharePoint sites from a Microsoft Purview retention policy.

- Product
- Microsoft Purview / SharePoint
- Device & OS
- not provided
- Scenario
- Managing compliance retention policies for a large scale of SharePoint sites.
- Observed behavior
- The Microsoft Purview interface restricts the number of SharePoint sites that can be selected for exclusion, preventing easy bulk administration through the GUI.
Ensure you have the necessary administrative privileges in Microsoft Purview and access to Exchange Online PowerShell or the Security & Compliance PowerShell module.
Use PowerShell for Bulk Exclusions in Microsoft Purview
Since the visual interface restricts bulk site selection, using PowerShell is the most effective and officially supported way to exclude over 100 SharePoint sites simultaneously.
The Microsoft Purview compliance portal's web interface is optimized for smaller selections to maintain performance. To handle large-scale administrative tasks like excluding hundreds of URLs, you must use PowerShell administrative scripting.
Open your PowerShell terminal as an administrator and connect to the Security & Compliance PowerShell module using your global admin or compliance admin credentials.
Compile a list of the SharePoint site URLs you wish to exclude. For large volumes, it is best to save these URLs in a CSV file and import them into a PowerShell array variable.
Use the Set-RetentionComplianceRule cmdlet along with the -AddSharePointLocationException parameter. Pass your array of site URLs to append them to the policy's exclusion list in bulk.
Execute the Get-RetentionComplianceRule cmdlet to review the policy details and verify that the exclusions have been successfully applied and recognized by the system.

Looking for a Simpler Way to Manage Your Office Documents?
While managing enterprise compliance policies like SharePoint retention requires complex administrative tools, creating and editing daily documents shouldn't be a hassle. WPS Office offers a free, lightweight, and user-friendly suite for all your document, spreadsheet, and presentation needs.
- 1. Download WPS Office: Visit the official WPS website and click the download button for your operating system.
- 2. Install the Software: Run the downloaded installer file and follow the quick on-screen instructions to set up the application.
- 3. Start Creating: Launch WPS Writer, Spreadsheet, or Presentation to immediately start working with your Office files seamlessly.

Frequently Asked Questions
Why does the Microsoft Purview interface limit SharePoint site exclusions?
The web-based graphical user interface in Microsoft Purview is optimized for standard, day-to-day administrative tasks. Loading, rendering, and processing hundreds of site selections visually can cause performance degradation or timeouts, which is why PowerShell is the supported method for bulk actions.
Can I use a CSV file to exclude SharePoint sites via PowerShell?
Yes, utilizing a CSV file is highly recommended for bulk exclusions. You can list all your SharePoint site URLs in a CSV file, import it into your PowerShell session using the Import-Csv cmdlet, and loop through the data to apply exclusions programmatically.
Will excluding a SharePoint site delete its existing retained data?
Excluding a site from a retention policy simply stops the policy from applying to that site moving forward. It does not automatically delete the data. Instead, the data will become subject to the site's default deletion settings or any other retention policies that may still apply.




