Thursday, September 19, 2013

Unable to access or login failed for user to connect with Content Database of Sharepoint 2010

I came across an issue while connecting U2UCaml Builder with my site collection using Sharepoint 2010 object model and i got SQL Exception  unable to connect to SQL :database login failed for user to connect with Content Database etc...

I checked for my user rights and  it is in Site Collection  Admin as well as Farm Admin group then i tried accessing the database directly from SQL Management Studio , it says database can't be accessible

so i came to a solution with following power shell commands, i thought to share with all.

1. Open your SharePoint 2010 Management Shell as an Administrator

2. Run the following script

  $app = Get-SPWebApplication -identity “yourwebappname”
  $app.GrantAccessToProcessIdentity(“domain\username”)

No comments:

Post a Comment