Set-VMReplicationServer

Set-VMReplicationServer

Configures a host as a Replica server.

语法

Parameter Set: AuthenticationPort
Set-VMReplicationServer [[-ReplicationEnabled] <Boolean]> ] [[-AllowedAuthenticationType] <RecoveryAuthenticationType> {Kerberos | Certificate | CertificateAndKerberos} ] [[-ReplicationAllowedFromAnyServer] <Boolean]> ] [-CertificateAuthenticationPort <Int32]> ] [-CertificateThumbprint <String> ] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-DefaultStorageLocation <String> ] [-Force] [-KerberosAuthenticationPort <Int32]> ] [-MonitoringInterval <TimeSpan]> ] [-MonitoringStartTime <TimeSpan]> ] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: AuthenticationPortMapping
Set-VMReplicationServer [[-ReplicationEnabled] <Boolean]> ] [[-AllowedAuthenticationType] <RecoveryAuthenticationType> {Kerberos | Certificate | CertificateAndKerberos} ] [[-ReplicationAllowedFromAnyServer] <Boolean]> ] [-CertificateAuthenticationPortMapping <Hashtable> ] [-CertificateThumbprint <String> ] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-DefaultStorageLocation <String> ] [-Force] [-KerberosAuthenticationPortMapping <Hashtable> ] [-MonitoringInterval <TimeSpan]> ] [-MonitoringStartTime <TimeSpan]> ] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

详细说明

The Set-VMReplicationServer cmdlet configures a host as a Replica server and enables you to specify the types of authentication and ports to use for incoming replication traffic.

To restrict the replication traffic that the Replica server will accept by allowing it only from specific servers, use the New-VMReplicationAuthorizationEntry cmdlet.

参数

-AllowedAuthenticationType<RecoveryAuthenticationType>

Specifies which authentication types the Replica server will use. Allowed values are Kerberos, Certificate, or CertificateAndKerberos.

别名

AuthType

是否必需?

false

在哪里?

2

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-CertificateAuthenticationPort<Int32]>

Specifies the port on which the Replica server will receive replication data using certificate-based authentication. This parameter can be set only when the value of the AllowedAuthType parameter is Certificate or CertificateAndKerberos.

别名

CertAuthPort

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-CertificateAuthenticationPortMapping<Hashtable>

When using Hyper-V Replica with failover clustering and certificate-based authorization, you can use this parameter to specify a different port for each node of the cluster to receive replication. We recommend that you specify a unique port for each node of the cluster, and one unique port for the Hyper-V Replica Broker. This parameter can be set only when the Replica server is configured with an authentication type of Certificate or CertificateAndKerberos.

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-CertificateThumbprint<String>

Specifies the certificate to use for mutual authentication of the replication data. This parameter is required only when Certificate is specified as the type of authentication. Specify the thumbprint of a valid computer certificate from the Personal store.

The certificate must have all of the following properties to be valid:

     --It must not be expired.

     --It must include both client and server authentication extensions for extended key usage (EKU), and an associated private key.

     --It must terminate at a valid root certificate.

     --It must meet the requirements for the subject common name (CN):

           -- For servers that are not clustered, the subject common name (CN) must be equal to, or subject alternative name (DNS Name) should contain, the FQDN of the host.

           -- For servers that are clustered, each node must have two certificates – one in which the subject common name (CN) or subject alternative name (DNS Name) is the name of the node, and the other in which subject common name (CN) or subject alternative name (DNS Name) is FQDN of the Hyper-V Replica Broker.

To display a list of certificates in the computer’s My store and the thumbprint of each certificate, run the following commands:

PS C:\> cd cert:\LocalMachine\My
PS C:\> dir | format-list

For more information about certificate stores, see https://technet.microsoft.com//library/cc757138.aspx.

别名

Thumbprint

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

True (ByPropertyName)

是否接受通配符?

false

-CimSession<Microsoft.Management.Infrastructure.CimSession[]>

在远程会话中或远程计算机上运行该 cmdlet。输入计算机名或会话对象,如 New-cimsessionGet-cimsession cmdlet 的输出。默认为本地计算机上的当前会话。

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-ComputerName<String[]>

Configures Replica server settings for one or more Hyper-V hosts. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use localhost or a dot (.) to specify the local computer explicitly.

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-Credential<System.Management.Automation.PSCredential[]>

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-DefaultStorageLocation<String>

Specifies the default location to store the virtual hard disk files when a Replica virtual machine is created. You must specify this parameter when ReplicationAllowedFromAnyServer is True.

别名

StorageLoc

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-Force

Specifies whether the command runs without requiring confirmation.

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-KerberosAuthenticationPort<Int32]>

Specifies the port that the HTTP listener uses on the Replica server host.

别名

KerbAuthPort

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-KerberosAuthenticationPortMapping<Hashtable>

When using Hyper-V Replica with failover clustering and Kerberos authorization, you can use this parameter to specify a different port for each node of the cluster to receive replication. We recommend that you specify a unique port for each node of the cluster, and one unique port for the Hyper-V Replica Broker. This parameter can be set only when the Replica server is configured with an authentication type of either Kerberos or CertificateAndKerberos.

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-MonitoringInterval<TimeSpan]>

Specifies how often (the monitoring interval) replication statistics are computed. Valid values are: 1 hour, 2 hours, 3 hours, 4 hours, 6 hours, 8 hours, 12 hours, 24 hours, 2 days, 3 days, 4 days, 5 days, 6 days, 7 days. Specify in the format days:hours:minutes:seconds, such as 01:00:00 for 1 hour, or 1.00:00:00 for 1 day.

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-MonitoringStartTime<TimeSpan]>

Specifies when the monitoring interval starts.

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-Passthru

Specifies that a VMReplicationServer object is to be passed through to the pipeline representing the replication settings of the Replica server.

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-ReplicationAllowedFromAnyServer<Boolean]>

Specifies whether to accept replication requests from any server. When specified as true, DefaultStorageLocation must also be specified. The default storage location and DEFAULT trust group tag are used for virtual machine replicas.

别名

AllowAnyServer

是否必需?

false

在哪里?

3

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-ReplicationEnabled<Boolean]>

Specifies whether the host is enabled as a Replica server.

别名

RepEnabled

是否必需?

false

在哪里?

1

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-Confirm

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

是否必需?

false

在哪里?

named

默认值

false

是否接受管道输入?

false

是否接受通配符?

false

-WhatIf

显示在 cmdlet 运行时将发生的情况。该 cmdlet 不运行。

是否必需?

false

在哪里?

named

默认值

false

是否接受管道输入?

false

是否接受通配符?

false

<CommonParameters>

此 cmdlet 支持常见的参数:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。有关详细信息,请参阅 TechNet 上的 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

输入

输入类型是可以传送到 cmdlet 的对象的类型。

输出

输出类型是 cmdlet 发出的对象的类型。

  • None by default; VMRecoveryServer if –PassThru is specified.

示例

Example 1

This example configures the local host as a Replica server and specifies Kerberos for authentication.

PS C:\>  Set-VMReplicationServer $true –AllowedAuthenticationType Kerberos 

Example 2

This example configures a Replica server that accepts replication from all authenticated servers and uses a default storage location of d:\DefaultReplicaStorage.

PS C:\>  Set-VMReplicationServer –ReplicationEnabled $true AllowedAuthenticationType Kerberos –ReplicationAllowedFromAnyServer $true –DefaultStorageLocation d:\DefaultReplicaStorage

Example 3

This example configures the Replica server with a monitoring interval of 12 hours starting at 17:00 hours.

PS C:\>  Set-VMReplicationServer –MonitoringInterval "12:00:00" –MonitoringStartTime "17:00:00"

Example 4

This example configures the nodes of the cluster to receive replication on different ports. The first command declares a variable named portmapping and uses it to store the server names of the nodes and the port to use on each node. The second command configures each node of the cluster to use port mapping for Kerberos authentication using the values stored in the portmapping variable.

PS C:\> $portmapping = @{"Server1.contoso.com" = 82; "Server2.contoso.com" = 81; "Broker.contoso.com" = 80}
PS C:\> Set-VMReplicationServer -KerberosAuthenticationPortMapping $portmapping