MSFT_SPJoinFarm/MSFT_SPCreateFarm - ConfigDB registry key check
See original GitHub issueDetails 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:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
This has been rolled in to dev and will be included in our next release. Closing this issue.