Powered By Blogger

Jul 12, 2012



Delete Web Applications and Site Collections using SharePoint 2010 Management Shell


This blog post describes how to delete Web applications and Site Collections using SharePoint 2010 Management Shell.

Delete a Site Collection

First you have open the SharePoint 2010 Management Shell. Make sure that you run the program as the Administrator.

We use the command Remove-SPSite to remove the site. Then give the URL of the site collection which you wish to delete.



Then you will get a confirmation window asking  whether you want perform this action or not. Then insert "A" to confirm.



Now the Site collection has successfully deleted. If you try to access the site then you will get an error message like below.



Delete a Web Application

Before you delete a Web Application you should satisfy the below mentioned requirements.

1. You should be a member of the local administrators group on the computer's running Central Administration.
2.If you want to delete the content databases associated with the Web Application then you need to have the SharePoint_Shell_Access role within this content databases.

We use the command  Remove-SPWebApplication to remove the web application. Then give the site name.


Then you will get a confirmation window asking whether you want perform this action or not. Then insert "A" to confirm.


This command will not delete the content databases. If you want to delete the Content databases use the command Remove-SPContentDatabase.


Then you will get a confirmation window asking whether you want perform this action or not. Then insert "A" to confirm.



No comments:

Post a Comment