question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[SPShellAdmins] Setting specific DBs did not succeed

See original GitHub issue

Problem description

I always get an error when setting the ShellAdmins. This occurs on the BCS-DB and Secure Store. As far as I noticed the DBs are created differently than the others. In the SQL the farm account is not set at Security > Users at the specific DBs. Instead the dbo-Account uses the schema of the farm account. Could that be the problem?

Verbose logs

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
     "Cannot add DEV\Farm to the SharePoint_Shell_Access role of the database SP16-JUMP_ServiceApplication_BusinessDataConnectivity. A possible cause of this error
is that the account name was already added to the database as a login using a different user name than the account name."
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving BeginProcessing Method of Add-SPShellAdmin.
Some or all identity references could not be translated.
    + CategoryInfo          : InvalidData: (Microsoft.Share...AddSPShellAdmin:) [], CimException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShellAdmin
    + PSComputerName        : SERVER01

VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving ProcessRecord Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]:                            [[SPShellAdmins]AddShellAdmins] Leaving EndProcessing Method of Add-SPShellAdmin.
VERBOSE: [SERVER01]: LCM:  [ End    Set      ]  [[SPShellAdmins]AddShellAdmins]  in 0.8280 seconds.
The PowerShell DSC resource '[SPShellAdmins]AddShellAdmins' with SourceInfo 'D:\INSTALL\DSC\SharePoint.ps1::837::17::SPShellAdmins' threw one or more non-terminating
errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for
more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : SERVER01

DSC configuration

SPShellAdmins AddShellAdmins {
                    MembersToInclude     = @("DEV\Farm","DEV\Admins","DEV\ShellAdmins")
                    AllDatabases         = $true
                    IsSingleInstance     = "Yes"
                    PsDscRunAsCredential = $SpFarmAccount
                    DependsOn            = "[SPFarm]CreateOrJoinSharePointFarm"
                }

Suggested solution

Actually I don’t know whether my description includes the solution?!

SharePoint version and build

SharePoint 2016
16.0.5227.1000

Operating system the target node is running

OsName               : Microsoft Windows Server 2016 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsBuildLabEx    : 14393.4825.amd64fre.rs1_release.211202-1611
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.14393.4583
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.4583
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

SharePointDsc version

Name          Version Path
----          ------- ----
SharePointDSC 4.5.1   C:\Program Files\WindowsPowerShell\Modules\SharePointDSC\4.5.1\SharePointDSC.psd1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:27 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
HeKr09commented, Apr 12, 2022

@ykuijs I am going to to test your code I hope next week. I will install another system from scratch and I can rerun the first system. What do you think is the best way?

  • Rerun the first system with your improvement?
  • Install the other system from scratch with your improvement?

Nevertheless: When I read your comments, I wondered whether I am using the modules wrong… Maybe I don’t need to put the users in as shell Admin… Is this a way?

0reactions
HeKr09commented, Jan 4, 2023

Actually the error did not occur anymore! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add-SPShellAdmin (sharepoint-server)
When you run this cmdlet to add a user to the SharePoint_Shell_Access role, you must have membership in the securityadmin fixed server role...
Read more >
Get-SPShellAdmin (sharepoint-server)
Use the Get-SPShellAdmin cmdlet to return the names of all users who have the SharePoint_Shell_Access role in a database.
Read more >
Add-SPShellAdmin–user cannot exist in database
Connect to SharePoint config database using Management Studio · Open SharePoint config database · Change database dbo using the following command:
Read more >
Permissions error setting up SharePoint 2010 PowerShell ...
I realise installing SP on a DC is not advised but I've no alternative. I have checked:
Read more >
Add-SPShellAdmin
Use the Add-SPShellAdmin cmdlet to add a user to the SharePoint_Shell_Access role as follows: –If you specify only the user, the user is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found