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

  1. New site collection created using SharePoint 2010 Management Shell.
    clip_image002
  2. Site collection created. as per confirmation. Delete site collection using SharePoint 2010 Management Shell.
    clip_image004
  3. Press ENTER.
    clip_image006
  4. Site collection deleted.
    clip_image008

One Reply to “PowerShell To Delete Site Collection”

  1. 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..

Comments are closed.