How to delete a website which is having subsites in sharepoint 2010? I dont like to go to down level and start up deleting? i would like to delele site and subsites at a time?
|
MSDN Blog: Using PowerShell to Delete a Site with Subsites in SharePoint Server 2010 or SharePoint Automation: A Better Delete Web (stsadm extension) |
||||
|
|
|
Do you have the Publishing Infrastructure enabled? If so I believe you can do this from the Site Actions/Manage Content and Structure option. Just chose delete from the menu. |
|||
|
|
|
If you're trying to do this via the Object Model, then you're going to have to recurse down through the sites and delete from the bottom up. I've put together a function to do this (see below). However, I've also put together a more integrated solution in the form of an extension method, which can be found on my blog. SPFix: Deleting a site with subsites programmatically
|
||||
|
|
|
Depends on how you want to remove the site and it's corresponding sub-sites, whether by Powershell or programatically. If you are wanting to do this programatically, according to technet, you should be able to just use:
Otherwise, the other code related snippet and link provided by @Stuart should work. |
|||
|
|