user7400346
user7400346

Reputation: 909

Deleting Sharepoint Site Using PowerShell

I am trying to delete a sharepoint site using powershell:

Remove-SPSite -Identity "site url"

I keep receiving an error message:

"Cannot find an SPSite object with Id or Url"

I am using sharepoint powershell on the sharepoint server using a farm user. I don't get anything when I run $StackTrace after the command. Thank you

Upvotes: 0

Views: 855

Answers (1)

Mark Mascolino
Mark Mascolino

Reputation: 2292

Upon seeing your response to Guruparan's question, if you are trying to delete a subsite you need to use a different commandlet

Remove-SPWeb http://yourwebapp.example.com/sites/yoursite/yoursubsite

Reference: https://technet.microsoft.com/en-us/library/ff607890.aspx

Upvotes: 1

Related Questions