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

SharePoint - Field type [FieldName] is not installed properly. Go to the list settings page to delete this field.

Office 365 Groups - Quickly find the GUID of a O365 Group

Export Group Membership From Active Directory Using Power Query