Friday, October 17, 2014

SharePoint PowerShell Error: Cannot open database "Database-Name" requested by the login. The login failed. Login failed for user 'Domain\UserName'.

Problem:  SharePoint Admin tried backing up a SharePoint 2013 site collection with Backup-SPSite PowerShell cmdlet and got an error "Cannot open database "WSS_Content_demo" requested by the login. The login failed. Login failed for user 'HOSTING\DemoUser'."

Cannot open database database-name requested by the login. The login failed. Login failed for user

Root cause:
Although the SharePoint administrator is granted permission with "Add-SPShellAdmin" cmdlet, it grants permission to the user only on existing SharePoint content databases at the time of running this command. For new content databases created later on, we have to grant permission again!

Solution:
Run "Add-SPShellAdmin" cmdlet for the user. This gives access to all SharePoint databases:
 Get-SPDatabase | Add-SPShellAdmin "Domain\User"

Read more: How to grant access to run PowerShell cmdlets in SharePoint 2013



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...