Could not access content database
This article explains how to handle issue when site collection load is not working properly.
Problem
While trying to load SharePoint farm settings with SPDocKit I received the following message:
Could not access content database ‘Database Name’ on server ‘Server Name’. The site collections from this database will not be loaded.
Solution
In order for SPDocKit to load data from site collections, the user account running the load must be a member of the SharePoint_Shell_Access role on each of the content databases.
The process of adding a user account to the role must be repeated each time a new content database is added to the SharePoint farm. Both the SPDocKit console user and service account must be added to this role. To add a user account to the SharePoint_Shell_Access role:
Open SharePoint Management Shell.
Type the following PowerShell command: Add-SPShellAdmin -UserName DOMAIN\YourAccount (click here to learn more).
If you want to grant PowerShell shell access to a single database check this article for more details.
If you want to grant PowerShell shell access to all content databases run this script:
Please note! The cmdlet Add-SPShellAdmin is going to apply to all the current SharePoint databases. If more SharePoint databases are added in the future, you might have to re-run the cmdlet again.
The cmdlet might fail in some environments; please contact us for further assistance.
Last updated