SharePoint: Guidelines for Bulk File Version Deletion

Ben Wall 5 Reputation points
2025-07-30T18:59:01.66+00:00

My goal is to trim old versions of existing files on a massive amount of Sharepoint Online sites (tens of thousands), using the following job:

New-SPOSiteFileVersionBatchDeleteJob -identity [SiteURL] -DeleteBeforeDays 365

I have concerns about the scalability of this, but I can't find any details documented online. I assume running 10,000+ batch delete jobs would get throttled at some point, causing the jobs to start failing, but have no idea when a throttle might occur (could be 10 jobs, 50, 1000, etc).

Does anyone have any guidelines for running these sorts of background jobs in bulk? How many could I safely queue up at one time, and what negative impacts should I expect in my tenant if I exceed some job limit?

Microsoft 365 and Office | SharePoint | For education | Windows
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Ruby-N 1,750 Reputation points Microsoft External Staff Moderator
    2025-07-30T21:15:35.18+00:00

    Dear @Ben Wall

    Welcome to the Q&A Community. 

    Thank you for sharing your concerns. Based on your description, here are some key recommendations to help manage large-scale version deletion jobs in SharePoint Online: 

    Firstly, SharePoint Online applies throttling to protect service performance. Since Microsoft doesn’t publish exact limits, we recommend running deletion jobs in smaller batches (e.g., 100–500 items) rather than all at once. 
    Therefore, you can use the Get-SPOSiteFileVersionBatchDeleteJobStatus cmdlet to track the status of your jobs. If you notice frequent failures, it may be a sign of throttling. 

    After that you can submit jobs gradually instead of all at once, use scripts to manage job flow and reduce system load and look for throttling-related messages to understand system impact.  Be attention that submitting too many jobs at once can lead to failures, slow site performance, or even temporary service disruptions.  For detailed guidance, please refer to the steps outlined in the link below: 

    Tutorial: Queue a trim job - SharePoint in Microsoft 365 | Microsoft Learn 

    New-SPOSiteFileVersionBatchDeleteJob (Microsoft.Online.SharePoint.PowerShell) | Microsoft Learn 

    You can try this workaround and update us. If the issue still appears please feel free to let us know and we will keep assisting you. Please know that we truly appreciate your patience and understanding as we strive to support you. We are here to help. Thank you very much for your understanding and cooperation.    


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.