In this post, we will learn how to grant access to content database using PowerShell in SharePoint 2016 and 2013?
In SharePoint 2016, one of the prerequisites to configure Excel Services is granting the service account access to the SharePoint content database.
below are the steps to prepare a service account for an application service in SharePoint:
- Create a domain account to run the Excel Services application pool.
- Register the new account to the Managed Accounts in the Central Administration.

- Grant permission for the this account to access SharePoint content database.
You might also like to read SharePoint 2019: Register Managed Account using PowerShell
How to grant access to content database using PowerShell?
- Open SharePoint 2016 Management Shell as Administrator.

- Type the following command with your entry.
$w = Get-SPWebApplication -identity http://WebAppURL
$w.GrantAccessToProcessIdentity("domain\username")

Note: If you intend to add additional content databases in the future, you must repeat these cmdlets for each new one to ensure that Excel Services has access to each new database.
Applies To
- SharePoint 2016.
- SharePoint 2013.
Great hint, Thank you.
You’re welcome