Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

Confirm
Are you sure you want to perform this action?
Performing operation "Remove-SPSite" on Target
"http://intranet.sharepoint2010.com/portalll/DeleteMe".
[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 ?

Edit

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.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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
share|improve this answer
    
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 –  Muhammad Raja Jan 23 '13 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. –  Muhammad Raja Jan 23 '13 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 –  Muhammad Raja Jan 23 '13 at 12:13
    
What role SPAdmin has in your SharePoint installation? –  Falak Mahmood Jan 23 '13 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 –  Muhammad Raja Jan 23 '13 at 12:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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