How to set Site Closure and deletion Policy in SharePoint Online using CSOM?

Hello SharePointers,

Here is the Powershell code to set the site closure and deletion policy in Sharepoint online.

$policies = [Microsoft.SharePoint.Client.InformationPolicy.ProjectPolicy]::GetProjectPolicies($web.Context, $web)

$policy = $policies | ?{$_.Name -eq ” Office Policy”}

if ($policy) {

# Apply the policy.
[Microsoft.SharePoint.Client.InformationPolicy.ProjectPolicy]::ApplyProjectPolicy($web.Context, $web, $policy)

Happy SharePointing Folks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *