0x80070003

If you have received this error, good luck! This one blows!

Scenario

I was creating a batch of site collections and suddenly it was impossible to just visit or delete this sites. I had orphan sites.

Solution

I tried a few things from the blog here: http://wscheema.com/blog/Lists/Posts/Post.aspx?ID=20, but in the end I tried the last option which was removing the site collection from the content database by Powershell.
Since there were quite a few site collection that got corrupted, I wrote a PowerShell script which receives a URL as parameter.

param ( [string] $siteUrl = "$(Read-Host 'Enter the site url')" )
 function Main() {
          Add-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue
          $site = Get-SPSite $siteUrl
          $siteId = $site.Id
          $siteDatabase = $site.ContentDatabase
          $siteDatabase.ForceDeleteSite($siteId, $false, $false)
          Remove-PSSnapin Microsoft.SharePoint.PowerShell
}
Main

Reacties

Populaire posts