PowerShell To Delete Site Collection
It’s easy to create a site collection using PowerShell as seen in an earlier post. Now let’s see how easy it is to delete a site collection using PowerShell cmdlet. It’s any day efficient way to create and delete site collections using PowerShell then use Central Administration GUI.
For the purpose of testing we will
· Create a site collection named 2Delete using a site template STS#0
· Delete a site collection named 2Delete
- New site collection created using SharePoint 2010 Management Shell.
- Site collection created. as per confirmation. Delete site collection using SharePoint 2010 Management Shell.
- Press ENTER.
- Site collection deleted.
July 2nd, 2010 at 9:18 am
i was try to remove site with “Remove-SPSite http://…..”
But i get error below :
Remove-SPSite : Cannot find an SPSite object with Id or Url: http://win-2k8:23349/algolab/.
At line:1 char:14
+ Remove-SPSite <<<< http://win-2k8:23349/algolab/
+ CategoryInfo : InvalidData: (Microsoft.Share…mdletRemoveSite:SPCmdletRemoveSite) [Remove-SPSite], SPCmdletPipeBindException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRemoveSite
The site that i want to delete is in http://win-2k8:23349/algolab.
Why i get error like that?help me please..