Showing posts with label delete subsite. Show all posts
Showing posts with label delete subsite. Show all posts

12 May, 2013

Deletion of Subsite, Site Collection, Document Library, SharePoint List- SharePoint 2010

Most commonly used entities in SharePoint are Subsite, site collection, list and libraries. 

GUI mode will be the easiest mode to do any functional activities associated with them. In this article, i am more concentrating on the PowerShell mode because its very easy and efficient way to clean the activity directly from the database. 

Let's try to explore some deletion functionalities by means of PowerShell.

How to delete a site collection by using PowerShell?
Remove-SPSite [-Identity] <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DeleteADAccounts <SwitchParameter>] [-GradualDelete <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Example: Remove-SPSite -Identity http://SharePoint2010/sites/test2010

Where:
SharePoint2010: web application URL.
Sites: wildcard entry.
test2010: site collection that you want to delete.

Note: The above will completely deletes an existing site collection and all subsites. This operation cannot be undone.

How to delete a Subsite by using PowerShell?
Remove-SPWeb [-Identity] <SPWebPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Recycle <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Example: Remove-SPWeb -Identity http://SharePoint2010/sites/test2010/subtest2010

Where:
SharePoint2010: web application URL.
Sites: wildcard entry.
test2010: site collection
subtest2010: Subsite that you want to delete.

If you want to delete multiple subsites in a single shot from a site collection then please refer the following site: http://get-spscripts.com/2010/10/delete-sharepoint-sub-sites-using.html

How to delete a Document Library by using PowerShell?
Please refer the following code by which you can delete a document library without any issues...

$web = Get-SPWeb urlofweb
$library = $web.lists["listname"]
$library.Delete()

How to delete a SharePoint List by using PowerShell?
Get-SPWeb “site collection link” | % {$_.Lists.Delete([System.Guid]$_.Lists["name of list"].ID)}

The above command will delete the mentioned list without any issues...

If you have any queries/questions regarding the above mentioned information then please let me know, Thank you. I would be more than happy to help you as well as resolves your issues...

30 March, 2011

Delete a site collection by using Central Administration + SharePoint 2010

1. Verify that you have the following administrative credentials:

 To delete a site collection, the user account that is performing this procedure must be a member of the Farm Administrators SharePoint group.

2. On the Central Administration Web site, on the Quick Launch, click Application Management

3. On the Application Management page, in the Site Collections section, click Delete a site collection.

4. On the Delete Site Collection page, in the Site Collection drop-down list, click the down arrow, and then click Change Site Collection.


The Select Site Collection dialog box appears.

5. In the Web Application drop-down list, click the down arrow, and then click Change Web Application.


The Select Web Application dialog box appears.

6. Click the name of the Web application that contains the site 
collection that you want to delete. 


Relative URLs of sites in the site collections of the Web application that you have selected appear on the Select Site Collection dialog box.

7. Click the relative URL of the site collection that you want to delete, and then click OK.

8. Read the Warning section and verify that the site collection information is correct.

9. On the Delete Site Collection page, click Delete.

The site collection that you select is deleted.


If you have any queries/questions regarding the above mentioned information then please let me know,Thanks...