0

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

2
  • Does Get-Spsite "url" gets you the site object ? Commented Sep 1, 2017 at 12:40
  • No it does not. I am able to get only the main site and also retrieve a list of all subsites. I only get this problem when I try to get or delete a subsite. Commented Sep 1, 2017 at 14:36

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.