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'."
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!
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.