I am trying to delete a just created site collection but it keep giving me this error,

PS C:\Users\svc_spadmin> Remove-SPSite -Identity "http://intranet.sharepoint2010
.com/portalll/DeleteMe" -GradualDelete

Are you sure you want to perform this action?
Performing operation "Remove-SPSite" on Target
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

Remove-SPSite : Cannot open database "WSS_Content_SharePoint2010" requested by the login. The login failed. Login failed for user 'SP\Svc_SPAdmin'. At line:1 char:14 + Remove-SPSite <<<< -Identity "http://intranet.sharepoint2010.com/portalll/De leteMe" -GradualDelete + CategoryInfo : InvalidData: (Microsoft.Share...mdletRemoveSite: SPCmdletRemoveSite) [Remove-SPSite], SqlException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRemoveSi te

Now if I logon to Central Admin and delete this site collection I don't have any kind of permission problem then why using powershell script ?


When I try to add myself to db owner I get this error and don;t see DB in User Mapping table.

enter image description here

Edit 2

I logged in as Administrator which I used to install SQL Server but I can't find any permissions on Content DB even tho I am able to browse sites in browser.

1 Answer 1


Are you sure that the account running the PowerShell has enough rights to perform the operation?

Have your tried an alternative stsadm?

STSADM -o deletesite -url <YOUR_SITE_URL_HERE> -force
  • I created this web application & site collection with using SPAdmin so I am not sure why it didn't added me to content db owners for this specific web app's content db Jan 23, 2013 at 11:45
  • When I try to add myself as content db using SQL Server Management tools it still says I don't have permissions for content db, I can't see this content db in list either to add myself to it. Jan 23, 2013 at 11:47
  • I added account SPAdmin to Content DB but still not sure why there was no permissions on content db at all, even tho there was no errors while creating it Jan 23, 2013 at 12:13
  • What role SPAdmin has in your SharePoint installation? Jan 23, 2013 at 12:23
  • Can't remember lol, but I just realized any web application I create, Content DB isn't getting any kind of permissions, but if I create a content db using powershell it gets SPFarm and another account. I can see SPAdmin in farm admins and its also a local admin too, maybe I need to add it to master database as owner too or problem could be because I installed SQL server using administrator account Jan 23, 2013 at 12:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.