SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a web application using powershell and I'm getting a log in error with the SP_Admin account. I'm not sure if I've made a mistake when I was setting up the environment, I might have created it with the wrong account. These are the permission mappings I see in SQL manager. Wondering if they are correct.

This is the error I get in the management shell.

share|improve this question

There are a couple of things to check from your very informative images:

  • Are you logged in as sp_admin while running the script?
  • Can you open and view Central Administration?
  • Do the sp_admin account have db_owner permissions on the SharePoint_AdminContent database? If not, add permission.
share|improve this answer

CONTOSO\sp_admin lacks appropriate permissions on the SharePoint_Admin_ database. Following best practices you should use the Add-SPShellAdmin cmd-let to grant permissions to the database. Steps:

  1. Logon using the farm account;
  2. Launch SharePoint Management Shell using "Run as Administrator";
  3. Run the following command, replacing by the actual value

    Get-SPDatabase | ?{$_.Name -eq "SharePoint_Admin_<Guid>"} | Add-SPShellAdmin –Username CONTOSO\sp_admin

Reference: Add-SPShellAdmin

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.