SharePoint storage

How to find and delete large files in SharePoint

Learn how to easily find, review, and delete large files to reduce search results clutter and increase available SharePoint storage capacity
Scott Ortlepp
Updated
April 16, 2025
3 min to read

The accumulation of large files in your SharePoint environment over time can consume a significant amount of storage space. Purchasing additional storage space for SharePoint Online is a costly monthly expense once you exceed the assigned quota of 1TB base + 10GB per licensed user.

Regularly reviewing and cleaning up large files can help avoid or reduce the need to buy additional storage at a premium.

In this article, we will step through several methods to find and remove these files.

Requirements

Roles & Licensing

  • SharePoint Admin – To view and action sites.
  • M365 Business or Enterprise License – Any Microsoft Business or Enterprise license that includes SharePoint P1 or P2.

Apps & Modules – Review 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 the large files report and delete large files. It requires SharePoint Admin to run.

Method 1 – Library views

SharePoint document libraries have a built-in column that enables you to display the file size of all items in your library. Sorting by File Size descending gives you a quick view of the largest files.

However, if you have folders inside your library, the columns will show an item count of items directly below them instead.

To create a view that shows all files without folders, edit your current view in advanced mode and select the ‘Show all items without folders’ option within the ‘Folders’ section and save your changes

Once you’ve found the large files that are no longer needed, you can then manually delete them using the standard SharePoint UI.

Pros of this method

  • Immediately available – End-users can create their own views on any library that they have edit access to.
  • Context – The users working with the view have context and an understanding of the files returned by the view and can confidently decide to remove any unneeded large files.

Cons of this method

  • Limited scope – Views are limited to the library you create them in, if a site has many libraries, this becomes a very tedious exercise.
  • Item limits – Library views are limited to 5000 items, libraries with more than 5000 items can be troublesome.
  • User dependent – This method relies on users regularly reviewing libraries that they have access to and removing any unwanted large files. Users are very seldom aware that their sites are bloated and cause storage issues, so they are unlikely to proactively take any action.

Method 2 – PowerShell

Step 1 - Generate the report

To generate a report which lists large files, you will need to connect to PnP Online via PowerShell. Ensure that you have the correct admin roles and the App Registration details to allow you to authenticate to your SharePoint instance.

Once connected to your SharePoint site, you can run the following command to fetch all files larger than a defined size (in our example 250MB) in the default ‘Documents’ library for the site:

Get-PnPListItem -List <Library Title> | Where-Object {($_.FieldValues.SMTotalFileStreamSize/1mb -gt 250) -and ($_.FieldValues.FileLeafRef -like "*.*")}

For a full report on all libraries with a site, you can run the Large Files Report.ps1 script once you have updated the following variables:

  • SiteURL – This is the site that you want to run the report on.
  • AppRegistrationId – The App Registration Client ID that will allow you to authenticate to your environment.
  • FileSize – The minimum file size, in megabytes, that will be returned in the report.
  • CSVReportPath – Where the report will be exported to.

Step 2 - Review the report

Once the report has been generated, you will need to review the results and remove any files that should remain in the library. Any files that remain in the report will be deleted in the next step.

Step 3 - Remove unwanted large files

To remove unwanted large files, you need to run the following command:

Remove-PnPListItem -List <Library Title> -Identity <Document ID>

If you want to perform this action in bulk, you can run the Delete Large Files.ps1 script. Once you have updated these variables:

  • SiteURL – The site that you want to run the report on.
  • LargeFileReportPath – The report that we worked on in the previous steps.

* Note: Allitems that are removed will go through the standard recycle bin process. To find out more about emptying the recycle bin via PowerShell: Clear-PnPRecycleBinItem| PnP PowerShell

Pros of this method

  • Detailed report – Scripting allows for detailed reporting.
  • Bulk actions – Reporting and deletion can be actioned in bulk.
  • Multiple libraries – The reports can be run against all libraries within the site at once.

Cons of this method

  • Manual – Whilst the script handles the generation of the report and the deletion of the files, it’s still a manual process for the admin to review the results.
  • Long runtimes – depending on the number of items in the libraries, the scripts take a long time to run, need to be monitored, and cannot be paused midway through.
  • Bulk Deletions – Bulk deletions via script can be risky to perform and the incorrect content could be accidentally deleted (although it can be recovered from the recycle bin).

Method 3 – SProbot

SProbot’s Large File cleanup tool makes it easy to identify, review, and clear unwanted large files within identified sites on your tenant (typically the largest and/or fastest growing sites).

Step 1 – Identify sites which consume the most storage

Use the Search functionality to identify the largest sites on your tenant:

Step 2 – Run a large file report

Within the selected site’s Storage tab, pick a file size threshold and last modified period (3, 6, 12 months, or anytime) and run your report. SProbot will now scan your site for files above your chosen threshold and notify you when the report is ready.

Step 3 – Review and delete

When you select the files you've identified as unwanted, you can see how much space you’ll save when they’re deleted.

You can also see a full activity history of deletions and how they've contributed to your storage saved.

Need to reduce SharePoint storage costs?
Use SProbot to find and deal with redundant, obsolete and trivial content on your tenant
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>