Loading...

How to Delete a SharePoint 404 Error When the Site Collection is Corrupt

SharePoint 404 Error Site Collection Corrupted (Error 0x80070003) How to Delete

Previously we took a look at a possible cause of a 404 error in SharePoint after a content database restoration. This time we have determined that the site collection is corrupt, and we don’t have any backups (you should always have backups). Another scenario is that we just want to get rid of the site collection, but for whatever reason, you cannot remove the site collection.

Attempting to Remove a Site Collection using Remove-SPSite and Remove-SPDeletedSite

First, we get the site name and id into a variable

$site = Get-SPSite http://domainname.com/sites/sitecollectionname
$siteguid = $site.id
echo $siteguid

Now we can try and remove the sites with both standard PowerShell commands:

Remove-SPSite -Identity $siteguid -GradualDelete -Confirm:$FalseRemove-SPDeletedSite -Identity $siteguidtext

Remove SharePoint Site Error

Neither one worked, so let’s try again with a different command. (https://msdn.microsoft.com/en-us/library/office/hh323680.aspx)  We will set the gradual delete and restorable both to false.

$siteDatabase = $site.ContentDatabase
$siteDatabase.ForceDeleteSite($siteId, $false, $false)

NOTE: The old DELETE FROM .[SiteMap] WHERE Id=’’ will not work on 2013.

Force Delete Site PowerShell

Now the site is gone and you can replace it with a fresh one.

By | 2017-06-02T02:31:49+00:00 October 16th, 2015|Categories: Enterprise IT, SharePoint Solutions|Tags: , , |

About the Author:

Ricardo is MetroStar's thought leader and subject matter expert for enterprise collaboration software. He has been providing MetroStar's customers with innovative collaboration and integration options for 10 years.