0

I have a farm that has over a thousand empty lists and libraries. I have found information on document retention policies that apply to specific documents, so that documents will be filtered according to set parameters, but I cannot find any help on removing full document libraries if they have sat empty for a certain amount of time.

I'd like to apply a retention rule that will delete all of my empty document libraries and lists if they have not had any items in them for, say one month. I also really don't want to sit and delete every single one of the empty lists and libraries manually.

1 Answer 1

0

This does not exist OOB. Retention policies specifically work on documents. Workflows are usually associated with documents, but you can have site workflows. However, site workflows would require 1) something to kick them off, and 2) the ability to delete a library. Now, there are solutions to scheduling workflows out there, and with the "call http web service" action, you could probably use that to delete a library.

However, the workflow route seems difficult and problematic. (for example, how will the workflow delete libraries on other sites? There are many issues with this).

But, what you are describing can easily be done with a PowerShell script, and PowerShell scripts can be scheduled for windows scheduled tasks. By "easy" I mean from a coding side, it wont be a fast script, as it will need to loop through all the libraries, checking to see if they are empty and meet your other conditions before deleting them.

1
  • Ok thank you. I will go through manually and remove each list and library.
    – Anonymous
    Commented Jun 29, 2015 at 18:58

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.