A quick example to determine Site or List has a Policy in SharePoint using PowerShell.
A little background – I was working on a request for a client where they were experiencing an error “The site was closed..” because some policy unknowingly was applied to the site. We did not have any background on provisioning of the site so the only way to run a PowerShell to determine if any kind of Site or List policy was applied to it.
To Check Site Policy on a Site, check if the feature id “063c26fa-3ccc-4180-8a84-b6f98e991df3” is enabled on it.
Run the following to verify –
Get-SPFeature -Site “SiteUrl” | Sort DisplayName,Id
check in the feature list if the ID is enabled.
To Check if any policy is applied on the list –
$website = Get-SPWeb -identity
$sharedDocs= $website.lists[“Shared Documents”];
$libraryPolicy = [Microsoft.Office.RecordsManagement.InformationPolicy.ListPolicySettings]($sharedDocs)
This will return the Policy name if exists on the List or Shared Documents as in our case.