Skip to content

Solution Automation RemoveFileVersionAuto

Barbarur edited this page Sep 6, 2024 · 6 revisions

Remove file versions

Solution Code: RemoveFileVersionAuto

Requirements

Run the solution with and account with at least SharePoint Admin role.

Parameters

Actions
Parameter Type Description
Delete all versions Required
Choice
Delete all the versions except the current active one. Versions are deleted completely and not sent to the recycle bin.
Keep few versions Required
Choice
Number of versions to keep in case not required to delete them all.
Keep number of versions Optional* Solution will keep the most recent chosen number of versions.
Keep versions created after (UTC) Optional* Solution will keep the versions created after the selected point in time.
Recycle Optional* Removed versions will be sent to the recycle bin, if no selected they will be completely deleted.
Delete Optional* Deleted versions won't be sent to the recycle bin.

How this Solution works

  1. Collects the required Sites.
  2. Add account as Site Collection Admin.
  3. Collects the required Libraries.
  4. Collects the required Files.
  5. Iterates through each File and removes the required versions.
  6. Records the information for each action in a CSV file.
Clone this wiki locally