Remove-SPSite 0x80070003 - Forcely delete Site Collection that cannot be deleted

1 comment
Hi All,

Today I got a chance to delete corrupted SharePoint Site Collection , when I tried to delete the same from the Central Administration ,”Delete Site Collection” page, the details are not loaded in that Page, Even I am not able to access the site .
So I want to give trial from Powershell, I have used Remove-SPSite command

Remove-SPSite -Identity "http://sitename"

But , I got the below Error

<nativehr>0x80070003</nativehr><nativestack></nativestack>
At line:1 char:1
+ remove-spsite http://XXX:123
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (Microsoft.Share…mdletRemoveSite:SPCmdletRemoveSite) [Remove-SPSite], DirectoryNotFoundException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRemoveSite

But, When I used the Get-SPSite command, It returned a valid object. Then I found a resolution by using the ForceDeleteSite

 $site = Get-SPSite http://siteurl
$siteId = $site.Id
$siteDatabase = $site.ContentDatabase
$siteDatabase.ForceDeleteSite($siteId, $false, $false


This is how , I have deleted the corrupted Site collection.
NOTE: My site collection got corrupted while I am doing migration activities from MOSS 2007 to SP 2013.

Thanks.
Hope it helps...



Related Post

1 comment: