Skip to content

Commit

Permalink
New parameter AuthenticationOrder (do New-DbaEndpoint)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasjordan committed Oct 29, 2023
1 parent 0f7bb63 commit fb24dd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions public/New-DbaEndpoint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ function New-DbaEndpoint {
RC4
RC4Aes
.PARAMETER AuthenticationOrder
The type of connection authentication required for connections to this endpoint. Defaults to Negotiate.
Options are:
Certificate
CertificateKerberos
CertificateNegotiate
CertificateNtlm
Kerberos
KerberosCertificate
Negotiate
NegotiateCertificate
Ntlm
NtlmCertificate
.PARAMETER WhatIf
Shows what would happen if the command were to run. No actions are actually performed.
Expand Down Expand Up @@ -115,6 +130,8 @@ function New-DbaEndpoint {
[string]$EndpointEncryption = 'Required',
[ValidateSet('Aes', 'AesRC4', 'None', 'RC4', 'RC4Aes')]
[string]$EncryptionAlgorithm = 'Aes',
[ValidateSet('Certificate', 'CertificateKerberos', 'CertificateNegotiate', 'CertificateNtlm', 'Kerberos', 'KerberosCertificate', 'Negotiate', 'NegotiateCertificate', 'Ntlm', 'NtlmCertificate')]
[string]$AuthenticationOrder = 'Negotiate',
[string]$Certificate,
[System.Net.IPAddress]$IPAddress = '0.0.0.0',
[int]$Port,
Expand Down Expand Up @@ -185,6 +202,7 @@ 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 ($Certificate) {
$outscript = $endpoint.Script()
Expand Down
2 changes: 1 addition & 1 deletion tests/New-DbaEndpoint.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
Describe "$CommandName Unit Tests" -Tags "UnitTests" {
Context "Validate parameters" {
[object[]]$params = (Get-Command $CommandName).Parameters.Keys | Where-Object { $_ -notin ('whatif', 'confirm') }
[object[]]$knownParameters = 'SqlInstance', 'SqlCredential', 'Name', 'Type', 'Protocol', 'Role', 'EndpointEncryption', 'IPAddress', 'EncryptionAlgorithm', 'Certificate', 'Port', 'SslPort', 'Owner', 'EnableException'
[object[]]$knownParameters = 'SqlInstance', 'SqlCredential', 'Name', 'Type', 'Protocol', 'Role', 'EndpointEncryption', 'IPAddress', 'EncryptionAlgorithm', 'AuthenticationOrder', 'Certificate', 'Port', 'SslPort', 'Owner', 'EnableException'
$knownParameters += [System.Management.Automation.PSCmdlet]::CommonParameters
It "Should only contain our specific parameters" {
(@(Compare-Object -ReferenceObject ($knownParameters | Where-Object { $_ }) -DifferenceObject $params).Count ) | Should Be 0
Expand Down

0 comments on commit fb24dd5

Please sign in to comment.