Deleting a large SharePoint library with retention labels applied to content

Iron Contributor

Are there any clever methods known to anyone for deleting a large SharePoint library that has retention label applied to all its content? I understand we will have to individually delete each item to empty out all folders before any folder and ultimately the library can be removed. Any other ideas?

4 Replies
What about writing a Script / Code that does the job?
Thanks @Juan. PowerShell is our course of action using the Remove-PnPListItem cmdlet. It is going to take few hours and I guess my post was to find out if there is any simpler or faster way but it appears there is not.

Adding more details...We ultimately decided to use the retention and disposal labels to accomplish this. Given the root cause behind library unable to be deleted is a long term retention label, deleting items using script was moving these to PreservationHoldLibrary where these will remain for a very long time.

As the data is duplicate and redundant, we have decided to create a new retention label to delete content after 2 days from creation date. This label will be applied to all items in library, making the built-in SharePoint function to then get rid of it for us.

@Gurdev Singh 


Deleting the Retention Label and the Policy used to publish it would have remove the label from every single file automatically. Then you could delete the library.