Skip to content

SE now requires a value for DatabaseConnectionEncryption (Connect-SPConfigurationDatabase) #100

@mrbubble62

Description

@mrbubble62

Connect-SPConfigurationDatabase now has a required parameter DatabaseConnectionEncryption, pressing enter for the default value fails as below. Adding -DatabaseConnectionEncryption:Mandatory to Line 1997 of AutoSPInstallerModule.psm1 worked OK for me.

https://learn.microsoft.com/en-us/powershell/module/sharepoint-server/connect-spconfigurationdatabase?view=sharepoint-server-ps

Connect-SPConfigurationDatabase -DatabaseName "$configDB" -Passphrase $secPhrase -DatabaseConnectionEncryption:Mandatory -DatabaseServer "$dbServer" @distCacheSwitch @serverRoleSwitch @databaseCredentialsParameter -ErrorAction SilentlyContinue

Server Subscription Edition Version 25H1
https://learn.microsoft.com/en-us/sharepoint/what-s-new/new-and-improved-features-in-sharepoint-server-subscription-edition-25h1-release

 - Attempting to join farm on "SharePoint_Config"...
PS>TerminatingError(Connect-SPConfigurationDatabase): "Cannot bind parameter 'DatabaseConnectionEncryption'. Cannot convert value "" to 
>> TerminatingError(Connect-SPConfigurationDatabase): "Cannot bind parameter 'DatabaseConnectionEncryption'. Cannot convert value "" to type "Microsoft.Data.SqlClient.SqlConnectionEncryptOption". Error: "Invalid value for key 'Encrypt'.""
--------------------------------------------------------------
 - Script halted!


Exception             : System.Management.Automation.ParameterBindingException: Cannot bind parameter
                        'DatabaseConnectionEncryption'. Cannot convert value "" to type
                        "Microsoft.Data.SqlClient.SqlConnectionEncryptOption". Error: "Invalid value for key
                        'Encrypt'." ---> System.Management.Automation.PSInvalidCastException: Cannot convert value ""
                        to type "Microsoft.Data.SqlClient.SqlConnectionEncryptOption". Error: "Invalid value for key
                        'Encrypt'." ---> System.ArgumentException: Invalid value for key 'Encrypt'.
                           at Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Parse(String value)
                           at System.Management.Automation.LanguagePrimitives.IsCustomTypeConversion(Object
                        valueToConvert, Type resultType, IFormatProvider formatProvider, Object& result, TypeTable
                        backupTypeTable)
                           --- End of inner exception stack trace ---
                           at System.Management.Automation.LanguagePrimitives.IsCustomTypeConversion(Object
                        valueToConvert, Type resultType, IFormatProvider formatProvider, Object& result, TypeTable
                        backupTypeTable)
                           at System.Management.Automation.LanguagePrimitives.ConvertCheckingForCustomConverter.Convert
                        (Object valueToConvert, Type resultType, Boolean recursion, PSObject originalValueToConvert,
                        IFormatProvider formatProvider, TypeTable backupTable)
                           at System.Management.Automation.LanguagePrimitives.ConversionData`1.Invoke(Object
                        valueToConvert, Type resultType, Boolean recurse, PSObject originalValueToConvert,
                        IFormatProvider formatProvider, TypeTable backupTable)
                           at System.Management.Automation.LanguagePrimitives.ConvertTo(Object valueToConvert, Type
                        resultType, Boolean recursion, IFormatProvider formatProvider, TypeTable backupTypeTable)
                           at
                        System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal
                        argument, String parameterName, Type toType, ParameterCollectionTypeInformation
                        collectionTypeInfo, Object currentValue)
                           --- End of inner exception stack trace ---
                           at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext
                        funcContext, Exception exception)
                           at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame
                        frame)
                           at
                        System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
                        frame)
                           at
                        System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
                        frame)
TargetObject          :
CategoryInfo          : InvalidArgument: (:) [Connect-SPConfigurationDatabase], ParameterBindingException
FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.SharePoint.PowerShell.SPCmdletConnectSPConfigurationDa
                        tabase
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at CreateOrJoinFarm, D:\install\AutoSPInstaller\SP\Automation\AutoSPInstallerModule.psm1: line
                        1997
                        at Set-FarmConfig, D:\install\AutoSPInstaller\SP\Automation\AutoSPInstallerMain.ps1: line 222
                        at <ScriptBlock>, D:\install\AutoSPInstaller\SP\Automation\AutoSPInstallerMain.ps1: line 454
                        at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
PSMessageDetails      :

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions