Get-VMReplication

Get-VMReplication

Gets the replication settings for a virtual machine.

Syntax

Parameter Set: VMName
Get-VMReplication [[-VMName] <String[]> ] [-ComputerName <String[]> ] [-PrimaryServerName <String> ] [-ReplicaServerName <String> ] [-ReplicationHealth <VMReplicationHealthState> ] [-ReplicationMode <VMReplicationMode> ] [-ReplicationState <VMReplicationState> ] [-TrustGroup <String> ] [ <CommonParameters>]

Parameter Set: VMObject
Get-VMReplication [-VM] <VirtualMachine[]> [ <CommonParameters>]

Detailed Description

The Get-VMReplication cmdlet gets the replication settings for a virtual machine.

Parameters

-ComputerName<String[]>

Specifies one or more Hyper-V hosts from which virtual machine replication settings are to be retrieved. 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.

Aliases

none

Required?

false

Position?

named

Default Value

.

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PrimaryServerName<String>

Specifies the primary server of the virtual machines whose replication settings are to be retrieved.

Aliases

PrimaryServer

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VM<VirtualMachine[]>

Specifies the virtual machine whose replication settings are to be retrieved.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMName<String[]>

Specifies the name of the virtual machine whose replication settings are to be retrieved.

Aliases

Name

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-ReplicaServerName<String>

Specifies the replica server name of the virtual machines whose replication settings are to be retrieved.

Aliases

ReplicaServer

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ReplicationHealth<VMReplicationHealthState>

Gets replication settings for virtual machines with the specified replication health state. Valid values are Normal, Warning, and Critical.

Aliases

Health

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ReplicationMode<VMReplicationMode>

Gets the replication settings for virtual machines with the specified replication mode. Valid values are None, Primary, Replica, and TestReplica.

Aliases

Mode

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ReplicationState<VMReplicationState>

Gets replication settings for virtual machines with the specified replication state. Valid values are:

Error

FailOverWaitingCompletion

FailedOver

NotApplicable

ReadyForInitialReplication

Replicating

Resynchronizing

ResynchronizeSuspended

Suspended

SyncedReplicationComplete

WaitingForInitialReplication

WaitingForStartResynchronize

Aliases

State

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TrustGroup<String>

Specifies the trust group of the virtual machines whose replication settings you want to retrieve.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • VMReplication

Examples

Example 1

This example gets the replication settings of all replication-enabled virtual machines on the local Hyper-V host.

PS C:\> Get-VMReplication

Example 2

This example gets the replication settings of a virtual machine named VM01.

PS C:\> Get-VMReplication VM01

Example 3

This example gets the replication settings of all virtual machines replicating to server server01.domain01.contoso.com.

PS C:\> Get-VMReplication –ReplicaServerName server01.domain01.contoso.com

Example 4

This example gets the replication settings of all virtual machines in the Replicating state.

PS C:\> Get-VMReplication –ReplicationState Replicating

Example 5

This example gets the replication settings of all virtual machines in a trust group named DEFAULT.

PS C:\> Get-VMReplication –TrustGroup DEFAULT

Example 6

This example gets the replication settings of all primary virtual machines on the local host.

PS C:\> Get-VMReplication –ReplicationMode Primary