SharePoint Online: Manage site policies using Powershell

Site Policy

Site policies define the lifecycle of a site. They specify when the site will be closed and when it will be deleted. As a SharePoint Administrator you can leverage site policies to control expansion of your sites, especially if users in your organization are allowed to create them freely.

For detailed instructions on how to set the policies using user interface, you can visit Use policies for site closure and deletion

Get

Site policies are special hidden content types, so you can retrieve them by using Get-PnPContentType cmdlet. They are based on Site Policy content type. Content types inheriting from parent content type show this inheritance in their ID, so we can easily find them by the content type id.

$ContentTypeID = "0x010085EC78BE64F9478AAE3ED069093B9963"
 
Get-PnPContentType `
| where {($_.Id -match $ContentTypeID) -and ($_.Id -notlike $ContentTypeID)}

Remove