I have a very strange situation - two sub webs were created through some code but it errored out part way through the process and now I am left two webs I can't seem to delete. The strange part is that I can see them as an error if I trying to create a new web with the same URL (it complains it already exists) and I get see them in PowerShell using Get-SPWeb for the parent site then enumerating the Webs property. Using the C# server side object model I can't even see the sites or get a reference to delete them!
Help! How can I delete these rogue sites?
Examples:
PowerShell
$web = Get-SPWeb http://server/web
$web.Webs
Url
---
http://server/web/OldMeetingSite
http://server/web/NewMeetingSiteA
http://server/web/NewMeetingSiteB
C# Server Side Object Model
using (SPSite site = new SPSite("http://server"))
{
using (SPWeb web = site.OpenWeb("web"))
{
foreach (SPWeb sub in web.Webs)
{
Console.WriteLine(sub.Url);
}
}
}
// output - only one site?!?!?
http://server/web/OldMeetingSite
Note: I can get some quasi-reference to the webs through PowerShell $webs.Webs[1] but the call to .Delete() fails with the message There is no web named "/web/NewMeetingSiteA".