I have an empty document library that is unable to be deleted with error "list cannot be deleted while on hold or retention policy" which hints that there are still files inside.

error message

I have even created a new view with no filters but there are no files visible.

empty library

In the Site Contents, the total shows there is 2 documents inside. I also synced the file to my PC and enable "Show hidden files" but still showing empty. I also checked in the library settings at the "Manage files with no checked in version" and yet no files are listed.

Site content showing 2 file count

I also tried to delete the library using PowerShell PnP with -force parameter but it shows the same error message.

Remove-PnPList -Identity $LibraryName -Force -recycle

P.S: If not mistaken the library was migrated from another platform using a migration tool. Not sure if it has anything to do with this

1 Answer 1


The error message means that the documents has been under hold or retention policy. If you are not an admin, please contact the tenant admin for more information.

However if you are sure there are no hold or retention policy configured in your tenant, and Remove-PnPList also does not help. It will be better to escalate to open a service request for this issue.

More information about retention policy:https://docs.microsoft.com/en-us/microsoft-365/compliance/retention?view=o365-worldwide

Check for retention policy, please go Admin Center>Compliance>Policies>Retention enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.