How to Find Large Files in SharePoint Online – A Comprehensive Guide

Mack John ~ Published: September 27th, 2024 ~ SharePoint ~ 7 Minutes Reading

Most of the SharePoint Online users struggle to find large files in SharePoint Online because they are unaware of how to use search or filter to locate files by size. If you are also facing this issue, this guide will help you to locate large files quickly and efficiently.

SharePoint is a widely used platform for collaboration purposes. Therefore, dealing with large files and folders is common especially as organizations expand their use of SharePoint for document management.  However,  to increase your knowledge base about SharePoint, you can learn about what is SharePoint in more detail.

To provide you clear and concise answer to your query, we have discussed steps to locate large files and why large files matter. However, we have also shown manual steps and PowerShell commands. Additionally, we have mentioned an ultimate solution when you need to migrate large files separately. Let’s move forward in this blog and explore how to find large files in SharePoint Online.

Why Do Finding Large Files Matter?

Locating and finding large files is an important task in SharePoint Online for managing site storage and optimizing site responses.

  • Impact on Performance – Larger files take longer to load, affecting the user experience.
  • Search efficiency – Bigger files can clutter search results which makes it more difficult to find relevant files.
  • Storage Intensive – SharePoint Online has storage Quota limits, and large files consume valuable space.
  • Efficient Compliance – It is important to track and manage oversized files for compliance and auditing purposes.

Whether you are an IT administrator or a SharePoint Online user it is necessary to learn how to find and manage large files for optimizing your SharePoint environment.

Find Large Files in SharePoint Online Using Storage Metrics

One of the simplest ways to locate large files in SharePoint Online is by using the Storage Metrics feature. This is a built-in method available to site admins that allows you to see the storage consumption of your site collection. However, it also helps you by providing details of individual files and folders.

Here are the steps for Finding Large Files:

Step 1. Firstly, navigate the SharePoint Online site.

Step 2. Secondly, click on the Settings” icon and select Site Settings.

Step 3. Lastly, under Site Collection Administration, click on Storage Metrics.

Step 4.  Finally, you will see the total storage used by the site. Additionally, you can also do a deep-down analysis for folders and individual files.

This method is good for quickly identifying the largest files within a specific site. However, it is unable to provide a tenant-wide view or allow you to automate the search process for multiple sites.

Search Large Files Using the Size Property

SharePoint Search allows you to filter and find large files by using Keyword Query Language (KQL). The Size property in KQL can help you locate files based on their size.

Example Queries:

  • Size > 5000000: Finds files larger than 5 MB.
  • Size > 100000 AND filetype:pdf: Finds PDF files larger than 1 MB.

Steps to search using this method:

  • Go to the Search bar on your SharePoint Online site.
  • Enter the above queries to filter files by size.

This method is fast, especially for users who don’t want to dive into administrative settings or PowerShell. However, it is limited to the site you are currently working on and doesn’t provide a bulk report.

Use PowerShell to Find Large Files

PowerShell provides a more robust and automated way to find large files across your SharePoint sites. The commands listed below can help you to generate detailed reports of large files. This command helps you to field files either in specific site collections or across the entire tenant.

PowerShell Script for Finding Files Over 1 GB:

# Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
# Function to find large files in SharePoint
Function Find-SPOAllLargeFiles([String]$SiteURL, [Microsoft.SharePoint.Client.Folder]$Folder) {
    # Logic to find and report large files
}
# Call the function
Get-SPOAllLargeFilesRpt "https://yourcompany.sharepoint.com/sites/sitecollection"

This script checks files larger than 1 GB in the given site collection and exports the data to a CSV file for further analysis.

Advantages of Using the PowerShell Method:

  • Automates the process of identifying large files.
  • Can be customized to suit your specific needs (size limits, file types, etc.).
  • Provides a detailed report that can be saved and shared.

Disadvantages :

  • Requires administrative access and knowledge of PowerShell.

Locate Large Files Across a Site Collection

For those looking to identify large files across an entire site collection, PowerShell offers a script that processes all document libraries within the site collection. Here is a PowerShell code to find files over 2 GB:

# Connect to SharePoint Online
Connect-PnPOnline -Url "https://yourcompany.sharepoint.com/sites/sitecollection" -Credentials (Get-Credential)
# Get all document libraries and find files larger than 2GB
$Libraries = Get-PnPList | Where-Object {$_.BaseType -eq "DocumentLibrary"}

This command helps in auditing large files across multiple libraries in a site collection, making it easier to manage oversized files across your SharePoint environment.

Find Large Files Across the Entire Tenant

Sometimes, you need to search for large files across the entire SharePoint Online tenant. This is especially useful for organizations with multiple site collections and thousands of users.

# Connect to Admin Center
Connect-PnPOnline -Url "https://yourtenant-admin.sharepoint.com" -Interactive
# Get all site collections and search for large files
$SiteCollections = Get-PnPTenantSite | Where-Object { $_.Template -NotIn ("SRCHCEN#0", "APPCATALOG#0") }

This method can provide a comprehensive view of all large files across your SharePoint Online tenant, making it easier to manage storage and implement strategies for handling large files.

Check File Sizes Along With Version History

Sometimes, it is not just the file size that matters but also its version history. Files with multiple versions can consume significant storage.

PowerShell Script of Checking Size:

# Get file sizes along with version history
Connect-PnPOnline -Url "https://yourcompany.sharepoint.com/sites/sitecollection" -Interactive
$Files = Get-PnPListItem -List "Documents" -Fields FileLeafRef, SMTotalFileStreamSize, _UIVersionString

This script helps identify large files and their version history which helps to enable you to manage both current and past file versions efficiently.

Alternate Solution For Migrating Large Files to a Sperate Site

In some scenarios, admins want to separate the large files to another site for better file organization. To facilitate this an admin can migrate the large file to another site by using an advanced solution. However, the manual method for migrating these large files requires lots of effort and time. 

In this case, if you want to go with an advanced and automated method you should use SharePoint Migrator. This tool is recommended by Microsoft MVPs and experts. You can download it from below by clicking on the download button.

Conclusion

Finding a Large file in SharePoint Online without knowing efficient search can be a hectic task for admins and users. However, it is crucial for optimizing performance, managing storage, and ensuring compliance. In this write-up, we have discussed how you can use different methods like Storage Metrics, Search with the Size, or advanced solutions like PowerShell to automate the search process across multiple sites or your entire tenant. Additionally, we have also mentioned a common scenario for managing large files and a solution to efficiently migrate large files.