Monday, October 22, 2012

Delete a Retention Information Management Policy that is Corrupt

 

We had a series of content type retention polices that for some reason ended up being corrupt.  When I would try to edit the policy through the user interface I would get an error:

image

No matter what I did through the user interface I would get that error.  To remedy this I wrote a little 4 line PowerShell script that deletes the policy.  The script accepts 3 arguments (site URL, list name, and content type). 

$w = Get-SPWeb $args[0]
$l = $w.lists[$args[1]]
$c = $l.ContentTypes[$args[2]]
[Microsoft.Office.RecordsManagement.InformationPolicy.Policy]::DeletePolicy($c)

The script deletes the policy and then the policy can be reconfigured through the site settings.

No comments:

Post a Comment