SharePoint governance

Increase available SharePoint storage: Clean up inactive sites

Learn how to free up valuable SharePoint storage, increase security, and improve Copilot readiness by archiving or deleting sites which aren't actively used.
Scott Ortlepp
Updated
August 15, 2025
5 min to read

SharePoint storage costs can quickly escalate when ROT (Redundant, Obsolete, Trivial) content accumulates across your tenant. This guide shows SharePoint administrators exactly how to identify and clean up inactive sites to reclaim valuable storage space.

Requirements

Roles & Licensing

SharePoint Admin – To view and archive sites.

M365 Business or Enterprise License – Any Microsoft Business or Enterprise license that includes SharePoint P1 or P2.

SharePoint Advanced Management – Necessary if the SAM Inactive Sites Policy method is used.

Apps & Modules – Update setting via PowerShell

PowerShell – There are several versions and ways to access PowerShell, in our guide we will use PowerShell ISE.

PnP PowerShell module – This module is used to export a unused SharePoint sites report and delete sites and requires SharePoint Admin to run.

Method 1 – SharePoint admin center

Step 1 - Generate the report

To use the SharePoint admin center to generate a report of the least active sites in your tenant, navigate to ‘Active Sites’, change the view to ‘Least active sites’ and then export the csv.

You will receive a report like the example below:

Step 2 - Archive or delete unused sites

Once you have identified the sites you would like to clean up and have confirmed with owners that they are not needed anymore, use the standard UI to simply delete the sites (or archive them if you have Microsoft 365 Archive configured on your tenant).

Advantages

  • Always available – By using the filters available in the normal SharePoint admin center, this report is always available and up to date.
  • No code – No code or scripts are required to perform the cleanup.

Disadvantages

  • Manual – This is a manual process, and it takes time to determine which sites meet the ‘unused’ criteria.
  • False positives – Some sites in SharePoint may be used as read-only resources resulting in them appearing as ‘unused’ when employees may be actively visiting and consuming information from them.
  • No delegation – Once you have determined a site is ‘unused’, you will need to follow up with the site owner(s) to find out if this is expected or if they still need the site.
  • No bulk actions – Without the ability to action items in bulk, this process becomes very time consuming for the admins and users involved.

Method 2 – PowerShell

Step 1 - Generate the report

To generate a report of inactive sites, you will need to connect to PnP Online via PowerShell. Ensure that you have the correct admin roles as described in the Requirements section, and the App Registration details to allow you to authenticate to your SharePoint instance.

Below is an example that will fetch inactive sites on ‘X’ date:

#Get all non-OneDrive sites
$SiteCollections = Get-PnPTenantSite -Filter "Url -like <Tenant URL> -and Url -notlike '-my.sharepoint.com/'" 

#Get all 'Inactive' site collections
$SiteCollections | Where {$_.LastContentModifiedDate -le <Date>} | Select Title, Url, LastContentModifiedDate, -LockState, Owner, IsHubSite,StorageMaximumLevel

To export a report, you can run the Export unused SharePoint sites.ps1 script once you have updated the required variables:

  • TenantAdminURL – The SharePoint Admin center URL for your tenant that is used when connecting to your SharePoint instance.
  • TenantURL – The root URL of you SharePoint site. This is used when fetching the inactive sites.
  • ClientID – The app registration ID used with connecting to your SharePoint instance.
  • DaysInactive – How many days since the last activity do you consider a site to be inactive. By default, this is set to 90 days.
  • CSVPath – Where you would like the inactive site csv report to be saved to.

Step 2 - Delete unused sites

To clean up (delete) an unused site, you can use the following command:

Remove-PnPTenantSite -Url <siteURL>

This will place the site into the SharePoint admin center recycle bin for 90 days before permanent deletion.

To perform deletion in bulk, you can use the Delete Unused SharePoint Sites.ps1 script to action the items in the csv report.

Advantages

  • Detailed Reports – You can use the scripts to pull more detailed reports than those directly from the SharePoint admin center.
  • Bulk Actions – Once the inactive sites report has been reviewed, sites can be deleted in bulk.

Disadvantages

  • Manual – Reports need to be run and actioned manually by a SharePoint Admin.
  • False positives – Some sites in SharePoint may be used as read-only resources resulting in them appearing as ‘unused’ when employees may be actively visiting and consuming information from them.
  • No delegation – Once you have determined a site is ‘unused’, you will need to follow up with the site owner(s) to find out if this is expected or if they still need the site.

Method 3 – SharePoint Advanced Management – Inactive sites policy

If you have the additional licensing for SharePoint Advanced Management (SAM) directly through a SAM license or through Microsoft 365 Copilot, you can set up an inactive sites policy to find any sites within your environment that are no longer being used.

For more information on how to do this, follow the Microsoft documentation on how to Create an inactive site policy.

Advantages

  • Easy to configure – Policies are quick to configure.
  • Reduced admin responsibility – With workspace owners being given the option delete inactive sites, there is less manual intervention.
  • Automated Archiving – If owners don’t action their inactive sites, they can automatically be archived or set to read only.

Disadvantages

  • Additional licensing – SAM capabilities require additional licensing.

Method 4 – SProbot

SProbot’s inactive site cleanup tools make it extremely easy to clear unused SharePoint sites from your tenant. It enables creates tasks for group/site owners to review and action, and then automatically archives a site/group if there is no response.

Option 1 - Health check and review

Inactive workspace reporting can be found in the Activity section of the Health check. Go to Reports > Health check to see all storage and security metrics for your tenant, and use the Inactive workspaces review button to see a detailed report.

The Inactive workspaces review enables you to define the criteria for inactivity (1, 2 or 3 years) before returning a set of results which can be reviewed and then actioned to either delete or archive sites or teams individually or in bulk.

Option 2 - Enable automatic cleanup

Don't want to manually clean up inactive sites, or don't know whether it's safe to? Automated inactivity cleanup sends group or site owners notifications when their sites reach the inactivity threshold you define, and then gives them the option renew, archive or delete each identified site. To use this, navigate to Cleanup > Tools (or go directly to it from the Report in Option 1).

Note: You need to have Microsoft 365 Archive set up on your tenant for this tool to show as available.

Select to enable automatic cleanup, and choose:

  1. The number of days before a SharePoint site is regarded as inactive.
  2. The frequency and number of reminders to send group/site owners before a site is archived.

When a site reaches the defined inactivity threshold, a cleanup task is created for all group/site owners. These tasks display under the My items tab for each owner in the bundled Workspaces app in Teams.

They can then decide to either renew – for another 90, 180 or 365 days depending on your configuration - or immediately archive or delete the Microsoft 365 group (or site only, if it’s not group connected).

You can also, as an admin, review workspaces across all users and choose to directly action them if you wish.

Advantages

  • No code – No code or scripts are required to perform the cleanup.
  • Only a few clicks – SProbot gets to work immediately finding any inactive sites within your environment.
  • Reduced admin responsibility – With workspace owners being given the option to renew, archive or delete inactive sites, there is less manual intervention.
  • Automated Archiving – If owners don’t action their inactive sites, they are automatically archived.
Need an easy way to clean up inactive sites?
Use SProbot to monitor and automatically archive unused sites
Need help with your SharePoint project?
We have helped organisations optimise their use of SharePoint since 2003
Get useful SharePoint and Teams insights first

See how SProbot can help you cut operational costs

We'll show you how to save on storage, tame content sprawl, and improve security.

Get a demo
1<style>
2/* Marquee animation */
3@keyframes marquee {
4  from { transform: translateX(0); }
5  to { transform: translateX(-100%); }
6}
7
8.marquee {
9	animation: marquee 60s linear infinite;
10}
11
12/* Optional - Pause on hover */
13animation-play-state: paused;
14</style>