Set-SqlHADREndpoint

设置数据库镜像终结点的属性。

语法

ByPath (默认值)

Set-SqlHADREndpoint
    [[-Path] <String>]
    [-Owner <String>]
    [-Certificate <String>]
    [-IpAddress <IPAddress>]
    [-AuthenticationOrder <EndpointAuthenticationOrder>]
    [-Encryption <EndpointEncryption>]
    [-EncryptionAlgorithm <EndpointEncryptionAlgorithm>]
    [-Port <Int32>]
    [-State <EndpointState>]
    [-Script]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByObject

Set-SqlHADREndpoint
    [-InputObject] <Endpoint>
    [-Owner <String>]
    [-Certificate <String>]
    [-IpAddress <IPAddress>]
    [-AuthenticationOrder <EndpointAuthenticationOrder>]
    [-Encryption <EndpointEncryption>]
    [-EncryptionAlgorithm <EndpointEncryptionAlgorithm>]
    [-Port <Int32>]
    [-State <EndpointState>]
    [-Script]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

说明

Set-SqlHADREndpoint cmdlet 更改数据库镜像终结点的属性。

示例

示例 1:设置数据库镜像终结点的端口号

PS C:\> Set-SqlHADREndpoint -Path "SQLSERVER:\Sql\Computer\Instance\Endpoints\MainDbmEndpoint" -Port 5050

此命令将名为 MainDbmEndpoint 的数据库镜像终结点的端口号设置为名为 Computer\Instance 的服务器实例上的 5050。

示例 2:启动数据库镜像终结点

PS C:\> Set-SqlHADREndpoint -Path "SQLSERVER:\Sql\Computer\Instance\Endpoints\MainDbmEndpoint" -State Started

此命令在服务器实例 Computer\Instance 上启动名为 MainDbmEndpoint 的数据库镜像终结点。

参数

-AuthenticationOrder

指定终结点使用的身份验证的顺序和类型。 . 如果指定的选项调用证书,则必须设置 Certificate 参数,除非证书已与终结点关联。 有效值为:

  • 证书
  • CertificateKerberos
  • CertificateNegotiate
  • CertificateNtlm
  • Kerberos
  • KerberosCertificate
  • 谈判
  • NegotiateCertificate
  • Ntlm
  • NtlmCertificate

参数属性

类型:EndpointAuthenticationOrder
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Certificate

指定终结点用于对连接进行身份验证的证书的名称。 远终结点必须具有与指定证书私钥匹配的公钥的证书。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Confirm

在运行 cmdlet 之前,提示你进行确认。

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Encryption

指定终结点加密设置。 有效值为:

  • 禁用
  • 已支持
  • 必选

参数属性

类型:EndpointEncryption
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-EncryptionAlgorithm

指定终结点使用的加密形式。 有效值为:

  • Aes
  • AesRC4
  • 没有
  • RC4
  • RC4Aes

RC4 算法仅用于支持向后兼容性。 当数据库处于兼容级别 90 或 100 时,只能使用 RC4 或 RC4_128 加密新材料,但不建议这样做。 为了提高安全性,请改用较新的算法,例如 AES 算法之一。

参数属性

类型:EndpointEncryptionAlgorithm
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-InputObject

指定要修改的终结点。 这必须是数据库镜像终结点。

参数属性

类型:Endpoint
默认值:None
支持通配符:False
不显示:False

参数集

ByObject
Position:2
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-IpAddress

指定终结点将侦听的 IP 地址。

参数属性

类型:IPAddress
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Owner

指定终结点的所有者。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Path

指定数据库镜像终结点的路径。 这是一个可选参数。 如果未指定,则使用当前工作位置。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

ByPath
Position:2
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Port

指定终结点用于侦听连接的 TCP 端口号。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Script

指示此 cmdlet 输出执行任务的 Transact-SQL 脚本。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-State

指定终结点的状态。 有效值为:

  • 已开始
  • 已停止
  • 禁用

参数属性

类型:EndpointState
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

显示 cmdlet 运行时会发生什么情况。 命令脚本未运行。

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False
别名:无线

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

SMO.Endpoint

输出

SMO.Endpoint