SharePoint grant access to content database PowerShell

In this post, we will learn how to grant access to content database using PowerShell in SharePoint 2016 and 2013?


SharePoint grant access to content database PowerShell

In SharePoint 2016, one of the prerequisites to configure Excel Services is granting the service account access to the SharePoint content database.

Create a service account for a service application in SharePoint 2016

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.
configure managed account - Security - 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.
Open SharePoint 2016 PowerShell - Upgrade and Migrate to Project Server 2016
  • Type the following command with your entry.
$w = Get-SPWebApplication -identity http://WebAppURL
$w.GrantAccessToProcessIdentity("domain\username")
SharePoint grant access to content database PowerShell
SharePoint grant access to content database PowerShell

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.
See Also

2 thoughts on “SharePoint grant access to content database PowerShell”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top