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 ‘Domain\User’.”
Root cause:
Although the SharePoint administrator is granted permission with the “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, we have to grant permission again later on!
Solution:
Run the “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?