Share via

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

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 and Office | Development | Microsoft 365 Developer Program
0 comments No comments

2 answers

Sort by: Most helpful
  1. Christophe Cervello (FLAIR-IT) 50 Reputation points
    2025-07-28T09:15:23.7866667+00:00

    Dear All,

    Sorry for the lack of answer. I have gotten the solutionand made a KB about it.

    Here my work.

    I hope this will help.

    Exclude site from retention policy (If you have any).

    Issues : cannot delete sites or documents on Sharepoint due to hold.

    To start you need the following Azure roles :

    Sharepoint administrator, compliance administrator, Security administrator, Exchange administrator.

        Wait once you validate ( and give the ticket reference number )

    1. Edit the Retention Policy:

            ○ Go to the Microsoft Purview compliance portal : https://purview.microsoft.com/

       ○ Select Data lifecycle management > Microsoft 365 > Retention Policies.

            ○ Choose the policy you want to edit and select Edit Policy on the three dots.

          

    Click on “next” 3 times :

    ○ Under Locations Applied, select "Let me choose specific locations" if not already selected.

     

            ○ Next to SharePoint Sites, click Exclude sites (if available). If it’s grayed out, proceed to the next step.

        2. Exclude a Site from the Retention Policy:

            ○ Select Exclude Sites.

            ○ Enter the URL of the Sharepoint site you want to exclude and click the plus (+) button or “Enter” on the keybord.

            ○ Check the box for the site. You can add other sites if needed.

            ○ After entering all the sites to exclude, click Exclude at the bottom of the window and then Save.

        3. Remove a SharePoint Site from the Retention Policy:

    • Next to SharePoint Sites, select Choose sites.
    • Click the “X” next to the site URL you want to remove from the policy.
    • Click next (suivant) twice.

    Select Done (Envoyer) and then Save.

    If this isn’t enough to delete the document, you can go to disable the retention Policy in some cases (Never Delete).

    Once this is done the policy is excluded from the site and then you will be able to delete contents in the SharePoint/OneDrive following the final steps below:

    Also, Run Invalid Retention Policy  https://aka.ms/PillarInvalidRetention, acknowledge and save.

     Step 3: Free up SharePoint and OneDrive Space and Free up the Preservation Hold Library:

    Add your account as a site admin in the Sharepoint administration center.

    • Access the site as a Site Collection Admin.

     

    • Empty the recycle bin as it is also calculated as part of your OneDrive storage quota.
    • Check in the storage metrics for preservation hold library folder and empty it. (Find it through Site contents -> Site settings ->

     (The preservation hold library is a folder created by retention policy to prevent deletion. This means that when a user deletes a file to the recycle bin and empties the content. an original copy of those files and folders would go to the Preservation hold library for compliance keeps as chosen in the retention policy and the folder would retain those files as much as it is requested to in the policy).

    To empty the preservation, hold library, edit the URL to look exactly like this https://contoso.sharepoint.com/personal/user1_contoso_com/Preservationholdlibrary to be able to view the delete option.

    In our example:

    https://newrestgroup.sharepoint.com/sites/NewrestTravelRetailBusinesIntelligence-Spain/_layouts/15/storman.aspx?root=PreservationHoldLibrary  

    Is changed into :

    ttps://newrestgroup.sharepoint.com/sites/NewrestTravelRetailBusinesIntelligence-Spain/PreservationHoldLibrary

    This will allow you to easily find the files you want to delete.

    • When the preservation hold library is emptied, it returns those files to the recycle bin where the contents can now be permanently deleted f there is no use for the files again.
    • This should free up space on the SharePoint/OneDrive.  

    Re-enable the Retention policies if disabled entirely and if not just excluded.

    If excluded, simply remove the address of the site from the exclusion list.

    Was this answer helpful?

    0 comments No comments

  2. Jack-Bu 6,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.

    Was this answer helpful?


Your answer

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