Skip to content

Instantly share code, notes, and snippets.

@arjancornelissen
Created January 3, 2016 22:00
Show Gist options
  • Save arjancornelissen/a5f72f33f64dcb3d86db to your computer and use it in GitHub Desktop.
Save arjancornelissen/a5f72f33f64dcb3d86db to your computer and use it in GitHub Desktop.
Blog CustomRetentionPolicy PowerShell
$MicrosoftOfficePolicy = [System.Reflection.Assembly]::Load("Microsoft.Office.Policy, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
[Microsoft.Office.RecordsManagement.InformationPolicy.PolicyResource]::ValidateManifest($policyResource)
#try to delete
try
{
[Microsoft.Office.RecordsManagement.InformationPolicy.PolicyResourceCollection]::Delete("Test-Policy-Resource")
}
catch{}
[Microsoft.Office.RecordsManagement.InformationPolicy.PolicyResourceCollection]::Add($policyResource)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment