Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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.