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.

MSFT_SPJoinFarm/MSFT_SPCreateFarm - ConfigDB registry key check

See original GitHub issue

Details of the scenario you try and problem that is occurring:

Installing a SharePoint Farm using Microsoft SPPLA scripts. Those still use SPCreateFarm and SPJoinFarm

A registry key could not be found exception was thrown as below.

VERBOSE: [APP-SHP21]: LCM:  [ End    Test     ]  [[SPCreateFarm]CreateSPFarm]  in 1.3910 seconds.
PowerShell DSC resource MSFT_SPCreateFarm  failed to execute Test-TargetResource functionality with error message: Specified registry key hklm:SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\16.0\Secure\ConfigDB could not be found.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure
    + PSComputerName        : APP-SHP21

The failure command was $configDbDsn = Get-SPDSCRegistryKey -Key $cfgDbRegKey -Value “dsn”

  • We tried to add -ErrorAction SilentlyContinue (like module MSFT_SPFarm) but no success. Still the exception is thrown back to the invoking host.

We ended wrapping the Get-SPDSCRegistryKey line with a try /catch and that fixes it.

The DSC configuration that is using the resource:

SPCreateFarm CreateSPFarm
            {
                DatabaseServer           = $ConfigurationData.NonNodeData.SQLServer.FarmDatabaseServer
                FarmConfigDatabaseName   = $ConfigurationData.NonNodeData.SharePoint.Farm.ConfigurationDatabase
                Passphrase               = $PassPhrase #$ConfigurationData.NonNodeData.SharePoint.Farm.Passphrase
                FarmAccount              = $FarmAccount
                PsDscRunAsCredential     = $SPSetupAccount
                AdminContentDatabaseName = $ConfigurationData.NonNodeData.SharePoint.Farm.AdminContentDatabase
                CentralAdministrationPort = $ConfigurationData.NonNodeData.SharePoint.Farm.CentralAdminPort
                ServerRole               = $Node.ServerRole
                DependsOn                = $FarmInstallTask
            }

Version of the Operating System and PowerShell the DSC Target Node is running: Windows Server 2016 b1607 PowerShell 5.1

Version of the DSC module you’re using: 1.7.0.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ykuijscommented, Jun 13, 2017

Believe it or not, I have been discussing this exact same issue with someone else 10 minutes ago and was about to create an issue for it 😃

Will implement a fix in my next rollup PR

0reactions
BrianFarnhillcommented, Jul 2, 2017

This has been rolled in to dev and will be included in our next release. Closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ConfigDB registry key check · Issue #621 · dsccommunity ...
Details of the scenario you try and problem that is occurring: Installing a SharePoint Farm using Microsoft SPPLA scripts.
Read more >
How SharePoint farm locates its configuration database
SharePoint actually stores the connection to the configuration database in the registry (see dsn key). SharePoint 2007: HKLM\SOFTWARE\Microsoft\ ...
Read more >
How to change the database server in a SharePoint farm
Open Registry Editor, and then verify that the ConnectionString value of the HKLM\SOFTWARE\Microsoft\AppFabric\V1.0\Configuration key is updated ...
Read more >
Why is changing the sharepoint configuration database ...
I have seen in a lot of places that the connection string to the sharepoint config DB is stored in the registry, but...
Read more >
Why Get-SPDatabase does not return ...
I've verified the web config files as well as the registry key for the Configuration database, but all look good. What other places...
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