PowerShell Script to Permanently Delete SPDeleted Sites

When you want to Backup, Delete and Restore a SharePoint SiteCollection, you might want to completely remove it from SharePoint. Otherwise you get the error when restoring:

No content databases are available for this operation but the site collection is scheduled for deletion in at least one content database. Either wait for the deletion operation to complete or create a content database, and then try the operation again. To create a content database, click “Content databases” on the Application Management page, select the Web application to use, and then click “Add a content database”.

You could wait for the default 30 day retention period to cleanup the deleted sitecollections, or execute it immediately.

For a specific Web Application:

For all Web Applications:

Don’t forget to manually trigger the [Gradual Site Delete] Timerjobs, who will perform the real cleanup.

Leave a Reply

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