how to unlock holds and delete a file in sharepoint when storage is full

Christophe Cervello (FLAIR-IT) 45 Reputation points
2025-06-10T13:07:33.93+00:00

Hello dear and friendly expert,

I turn to you on this day as I was unable to find a related topic ( though i just might be clumsy in my search ).

I am a system administrator and one of our local IT has a SharePoint where the settings where not set up properly as the version history of the files where set to never expire.

The setting is now corrected, however the issue exist that the storage capacity of the SharePoint is full. (1024go).

I have a file for example that is generated and has over 40k history version of itself for a grand total of about 760 Gb (roughly) and I figured that removing it and readding the latest version of the file would solve the congestion and allow us to manage easily the removal of all these history version files to clean up and save space.

However i get an error message when trying to delete the file mentionning a hold ( both on the sharepoint and on the onedrive ) here is the error message:

2025-06-05_16h10_31

2025-06-05_16h24_58

Is there a process to follow to figure out what holds are in place, release the lock on them and then clean up the sharepoint files before reinstalling the safety structure?

I hope i could explain clearly the issue.

Sincerely,

Chris

Microsoft 365 Developer Program
Microsoft 365 Developer Program
Microsoft 365: Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.Developer Program: A Microsoft program designed to help developers build cross-platform productivity experiences by giving them access to a developer subscription, sample data packs, documentation, training, experts, recommendations, and community events.
278 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jack-Bu 1,770 Reputation points Microsoft External Staff Moderator
    2025-06-10T15:03:29.03+00:00

    Hi Christophe Cervello (FLAIR-IT), 

    Thanks for reaching out to the Microsoft Q&A forum.  

    I understand you're having trouble deleting an old version of a file in SharePoint because it's on hold. It can be quite challenging when you're managing site content and run into these blockers.  

    Based on your description, your situation likely falls under one of the scenarios detailed in this Microsoft Learn article: An invalid policy blocks a SharePoint site deletion - SharePoint | Microsoft Learn

    To assist you in resolving this, you can run a diagnostic test in the Microsoft 365 admin center. This test will help verify if there's an invalid retention policy or if an eDiscovery hold is still within its grace period. 

    Here are the steps to follow: 

    Run Diagnostic Test 

    1. Select the Run Tests: Invalid Retention or grace eDiscovery Hold button to populate the associated test in the Microsoft 365 admin center: Run Tests: Invalid Retention or grace eDiscovery Hold 
    2. In the Run diagnostics section, either type or copy and paste the URL of the SharePoint or OneDrive site that you want to delete.  undefined
    3. Select Run Tests

    Based on Test Results

    I hope the above information gives you some clarity and points you in the right direction. If you run into any problems or have more questions, please feel free to reply to my answer. 

    ---------------------------------------  

    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.