Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Cannot delete a site collection using Remove-PnPTenantSite – Exception: Unknown Error

If you would like to remove a SharePoint or OneDrive site by PnP PowerShell it is possible you will receive the error “Cannot delete a site collection using Remove-PnPTenantSite”. Probably you are using some retention policy. Try to exclude the specific SharePoint or OneDrive site from the retention policy or disable the MS Purview retention policy.

Solution 1: Exclude the SharePoint or OneDrive site from the MS Purview retention policy

Solution 2: Temporary disable the MS Purview retention policy

After the solution above you can remove the SharePoint or OneDrive site by the command below

Remove-PnPTenantSite https://[myTenant].sharepoint.com/sites/[siteUrl]

Leave a Reply

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