Clean up the Preservation Hold Library
Recycle what is no longer held
Once a hold or retention policy has been released, the copies it kept can sit in the Preservation Hold Library for weeks. This checks each chosen site's library, works out which copies nothing keeps any more, and moves those to the site's recycle bin. Anything still held is left alone.
What it does
- How many preserved copies each site has, how many nothing keeps, and how much space they take.
- Which are still kept, by what, and until when.
- How many were recycled, still held, left alone or failed.
How it runs
- Sign in and choose sites. One, several or all.
- Policies and case holds. It asks whether to read retention policies and eDiscovery case holds from the compliance centre. Without them no copy can be shown as free, so the run only reports.
- The check. Every copy in every chosen library is read and checked, the same way as Why is this still here? on the search page.
- Confirm. The counts and size to be recycled, and what is left alone. Say no and you keep the report of the check.
- The run. Each site's oldest copy is tried first. If SharePoint refuses it, that site is left alone after one try. Stop asks before it stops; run it again later to carry on.
- The report. Recycled, still held, left alone, skipped and failed, per site and per copy, with SharePoint's own error for anything refused. It is in Report History.
How it works
Each chosen site's library is found and read the same way as the search, and every copy is answered the same way as Why is this still here?. Only copies with nothing keeping them are tried; held, indefinite and can't-tell copies are left alone without being touched.
On each site the copy preserved longest ago is tried first. If SharePoint refuses it, the site is left alone after that one try. Every copy is read again just before it is moved, and moved only if it is still the same copy; then it goes to the site's recycle bin, never deleted. SharePoint's refusal is reported as still held, not as a failure, and twenty-five refusals in a row stop that site.
Before each move a line is written to a log on this computer saying what is about to happen, and after it what did. A copy that fails is listed with SharePoint's own words and the run carries on. Stopping keeps what was moved in the recycle bin; running it again later carries on, because moved copies are no longer in the library.
What you need
- Site collection administrator on each site (the library is hidden).
- For policies and case holds: the Compliance Administrator role (or View-Only Retention Management), and an eDiscovery role for case holds.
What it will not do
- It never deletes: everything goes to the site's recycle bin and can be restored. Space is freed only when that bin is emptied - the Advanced Recycle Bin can do that.
- SharePoint decides what can go. A copy still under any hold, policy or label is refused, whatever this app thinks, and is reported as still held.
- Microsoft documents changing this library yourself as not supported. This tool only moves what SharePoint itself allows, and only to the recycle bin.
- Microsoft's 30 days after a hold or policy is released can't be skipped.
- OneDrive's own Preservation Hold Libraries are not included yet.
Microsoft's own documentation
- Learn about retention for SharePoint and OneDrive: The Preservation Hold Library, Microsoft's clean-up job and the second-stage recycle bin.
- Learn about retention policies and retention labels: Releasing a policy, and why a hold always wins.