Created
January 3, 2016 22:00
-
-
Save arjancornelissen/a5f72f33f64dcb3d86db to your computer and use it in GitHub Desktop.
Blog CustomRetentionPolicy PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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