Edit

Share via


Set-VMReplicationServer

Configures a host as a Replica server.

Syntax

AuthenticationPort (Default)

Set-VMReplicationServer
    [[-ReplicationEnabled] <Boolean>]
    [[-AllowedAuthenticationType] <RecoveryAuthenticationType>]
    [[-ReplicationAllowedFromAnyServer] <Boolean>]
    [-CertificateThumbprint <String>]
    [-DefaultStorageLocation <String>]
    [-KerberosAuthenticationPort <Int32>]
    [-CertificateAuthenticationPort <Int32>]
    [-MonitoringInterval <TimeSpan>]
    [-MonitoringStartTime <TimeSpan>]
    [-Force]
    [-Passthru]
    [-CimSession <CimSession[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

AuthenticationPortMapping

Set-VMReplicationServer
    [[-ReplicationEnabled] <Boolean>]
    [[-AllowedAuthenticationType] <RecoveryAuthenticationType>]
    [[-ReplicationAllowedFromAnyServer] <Boolean>]
    [-CertificateThumbprint <String>]
    [-DefaultStorageLocation <String>]
    [-KerberosAuthenticationPortMapping <Hashtable>]
    [-CertificateAuthenticationPortMapping <Hashtable>]
    [-MonitoringInterval <TimeSpan>]
    [-MonitoringStartTime <TimeSpan>]
    [-Force]
    [-Passthru]
    [-CimSession <CimSession[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

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.

Examples

Example 1

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

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

Example 2

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

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

Example 3

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

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

Example 4

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

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.

Parameters

-AllowedAuthenticationType

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

Parameter properties

Type:RecoveryAuthenticationType
Default value:None
Accepted values:Kerberos, Certificate, CertificateAndKerberos
Supports wildcards:False
DontShow:False
Aliases:AuthType

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CertificateAuthenticationPort

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.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:CertAuthPort

Parameter sets

AuthenticationPort
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CertificateAuthenticationPortMapping

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.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AuthenticationPortMapping
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CertificateThumbprint

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 Certificate stores.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Thumbprint

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ComputerName

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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

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

Parameter properties

Type:

PSCredential[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultStorageLocation

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:StorageLoc

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Specifies whether the command runs without requiring confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-KerberosAuthenticationPort

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:KerbAuthPort

Parameter sets

AuthenticationPort
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-KerberosAuthenticationPortMapping

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.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AuthenticationPortMapping
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MonitoringInterval

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.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MonitoringStartTime

Specifies when the monitoring interval starts.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Passthru

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicationAllowedFromAnyServer

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.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AllowAnyServer

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicationEnabled

Specifies whether the host is enabled as a Replica server.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RepEnabled

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

None

Default

VMRecoveryServer

If -PassThru is specified.