From d54667732535e85ab8bbb97c25034837f6847dbe Mon Sep 17 00:00:00 2001 From: mrbubble62 Date: Thu, 1 May 2025 14:06:31 -0400 Subject: [PATCH] Add DatabaseConnectionEncryption parameter SE now requires a value for DatabaseConnectionEncryption (Connect-SPConfigurationDatabase) --- SP/Automation/AutoSPInstallerModule.psm1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/SP/Automation/AutoSPInstallerModule.psm1 b/SP/Automation/AutoSPInstallerModule.psm1 index e1c6b5f..392afc8 100644 --- a/SP/Automation/AutoSPInstallerModule.psm1 +++ b/SP/Automation/AutoSPInstallerModule.psm1 @@ -1994,13 +1994,20 @@ Function CreateOrJoinFarm ([xml]$xmlInput, [System.Security.SecureString]$secPhr } Write-Host -ForegroundColor White " - Attempting to join farm on `"$configDB`"..." - Connect-SPConfigurationDatabase -DatabaseName "$configDB" -Passphrase $secPhrase -DatabaseServer "$dbServer" @distCacheSwitch @serverRoleSwitch @databaseCredentialsParameter -ErrorAction SilentlyContinue + + if($spYear -eq "SE") { + $databaseConnectionEncrption = @{DatabaseConnectionEncrption = "Mandatory"} + } + else{ + $databaseConnectionEncrption = @{} + } + Connect-SPConfigurationDatabase -DatabaseName "$configDB" -Passphrase $secPhrase -DatabaseServer "$dbServer" @databaseConnectionEncrption @distCacheSwitch @serverRoleSwitch @databaseCredentialsParameter -ErrorAction SilentlyContinue If (-not $?) { Write-Host -ForegroundColor White " - No existing farm found.`n - Creating config database `"$configDB`"..." # Waiting a few seconds seems to help with the Connect-SPConfigurationDatabase barging in on the New-SPConfigurationDatabase command; not sure why... Start-Sleep 5 - New-SPConfigurationDatabase -DatabaseName "$configDB" -DatabaseServer "$dbServer" -AdministrationContentDatabaseName "$centralAdminContentDB" -Passphrase $secPhrase -FarmCredentials $farmCredential @distCacheSwitch @serverRoleSwitch @serverRoleOptionalSwitch @databaseCredentialsParameter + New-SPConfigurationDatabase -DatabaseName "$configDB" -DatabaseServer "$dbServer" -AdministrationContentDatabaseName "$centralAdminContentDB" -Passphrase $secPhrase -FarmCredentials $farmCredential @databaseConnectionEncrption @distCacheSwitch @serverRoleSwitch @serverRoleOptionalSwitch @databaseCredentialsParameter If (-not $?) { Throw " - Error creating new farm configuration database"