Skip to content

Commit

Permalink
New-DbaEndPoint - Fix Auth Order Param issue
Browse files Browse the repository at this point in the history
It fails ..but only sometimes... when AuthenticationOrder is explicit
  • Loading branch information
potatoqualitee committed Nov 5, 2023
1 parent a1d5aa9 commit fc4b15c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/New-DbaEndpoint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function New-DbaEndpoint {
[ValidateSet('Aes', 'AesRC4', 'None', 'RC4', 'RC4Aes')]
[string]$EncryptionAlgorithm = 'Aes',
[ValidateSet('Certificate', 'CertificateKerberos', 'CertificateNegotiate', 'CertificateNtlm', 'Kerberos', 'KerberosCertificate', 'Negotiate', 'NegotiateCertificate', 'Ntlm', 'NtlmCertificate')]
[string]$AuthenticationOrder = 'Negotiate',
[string]$AuthenticationOrder, # defaults to Negotiate anyway
[string]$Certificate,
[System.Net.IPAddress]$IPAddress = '0.0.0.0',
[int]$Port,
Expand Down Expand Up @@ -202,7 +202,9 @@ function New-DbaEndpoint {
}
$endpoint.Payload.DatabaseMirroring.EndpointEncryption = [Microsoft.SqlServer.Management.Smo.EndpointEncryption]::$EndpointEncryption
$endpoint.Payload.DatabaseMirroring.EndpointEncryptionAlgorithm = [Microsoft.SqlServer.Management.Smo.EndpointEncryptionAlgorithm]::$EncryptionAlgorithm
#$endpoint.Payload.DatabaseMirroring.EndpointAuthenticationOrder = [Microsoft.SqlServer.Management.Smo.EndpointAuthenticationOrder]::$AuthenticationOrder
if (Test-Bound -ParameterName AuthenticationOrder) {
$endpoint.Payload.DatabaseMirroring.EndpointAuthenticationOrder = [Microsoft.SqlServer.Management.Smo.EndpointAuthenticationOrder]::$AuthenticationOrder
}
}
if ($Certificate) {
$outscript = $endpoint.Script()
Expand Down

0 comments on commit fc4b15c

Please sign in to comment.