
Oct 08, 2015
If you create site collections using a batch script, and if one of those was unreachable. As the site creation process may have failed thus any resources will not be provisioned correctly.File provisioning is one of the last operations that is performed during site creation, you may then get a HTTP400 response (bad request) accessing the site home page.
The symptoms of things not being okay will be fairly self-evident.
The Central Administration displays the site in the sites list, but without any reference to the Content Database where it should have been created. There is no way to remove it using the web interface as the pages that display information about the site have no content.
This can be fixed using a PowerShell script.
Get-SPSite will return a valid object, however Remove-SPSite will fail and say “Unknown SPRequest error.occurred”.
A quick solution, is to use “force delete” where the site cannot be deleted.
Use a not-so-well-known operation on the Content Database object:
Microsoft.SharePoint.Administration.SPContentDatabase::ForceDeleteSite(See here)
The PowerShell code is very simple:
$site = Get-SPSite http://siteurl $siteId = $site.Id $siteDatabase = $site.ContentDatabase $siteDatabase.ForceDeleteSite($siteId, $false, $false)
The bad site collection can thus be removed sucessfully!
How do your Excel skills stack up?
Test NowNext up:
- Non-Breaking Spaces & Non-Breaking Hyphens in Word
- Creating a simple Website and User Interface with MVC - Part 1
- Welcome to the new Edge
- Courage? …I’m feeling quietly confident
- Save time by using your Document Stencil
- Creating a simple Website and User Interface with MVC - Part 2
- Create Scenarios in Excel using cell names
- The awesomeness that is AngularJS - Part 2
- Speak well under pressure
- Absolute Cell References use in Formulas
Previously
- What Customers Want
- The awesomeness that is AngularJS - Part 1
- Entity Framework Code-First
- Introduction to Office 365 Video
- The Aussie Meat Pie of Managing Teams
- Cascaded Dropdowns in Nintex Forms
- Create a Chart Template in Excel
- Setting up your models in MVC
- No need for meeting notes anymore!
- “If you can’t measure it…”