SharePoint 2010 - Powershell Script to Disable Versioning on a specific List & Delete Old Versions

This will remove versioning from the list you specify & update every item so that the old versions are deleted.

Great for really large lists/libraries that don't require versioning when you want to free up some space.

$web = get-spweb "http://root/site"
$list = $web.Lists["List Name"]
$list.EnableVersioning = $false
$list.Update()

foreach($item in $list.Items) {
$item.URL;
$item.SystemUpdate();
}

Comments

Popular posts from this blog

How to Copy/Duplicate a Table and Columns in a Dataverse Environment

Export Group Membership From Active Directory Using Power Query

Microsoft Flow - Apply To Each Limitation (5000 items)