Get-VMReplication

Get-VMReplication

Gets the replication settings for a virtual machine.

语法

Parameter Set: VMName
Get-VMReplication [[-VMName] <String[]> ] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-PrimaryServerName <String> ] [-ReplicaServerName <String> ] [-ReplicationHealth <VMReplicationHealthState]> ] [-ReplicationMode <VMReplicationMode]> ] [-ReplicationRelationshipType <VMReplicationRelationshipType]> ] [-ReplicationState <VMReplicationState]> ] [-TrustGroup <String> ] [ <CommonParameters>]

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

详细说明

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

参数

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

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

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

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

别名

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

-PrimaryServerName<String>

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

别名

PrimaryServer

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-VM<VirtualMachine[]>

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

别名

none

是否必需?

true

在哪里?

1

默认值

none

是否接受管道输入?

True (ByValue)

是否接受通配符?

false

-VMName<String[]>

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

别名

Name

是否必需?

false

在哪里?

1

默认值

none

是否接受管道输入?

True (ByValue)

是否接受通配符?

false

-ReplicaServerName<String>

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

别名

ReplicaServer

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-ReplicationHealth<VMReplicationHealthState]>

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

别名

Health

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-ReplicationMode<VMReplicationMode]>

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

别名

Mode

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-ReplicationRelationshipType<VMReplicationRelationshipType]>

Specifies the replication relationship type of the virtual machine. Specify whether the replication relationship is a simple primary to replica or is an extended replication chain. The cmdlet gets the replication settings for the virtual machines that have the replication type that you specify.

别名

Relationship

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

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

别名

State

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-TrustGroup<String>

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

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

<CommonParameters>

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

输入

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

输出

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

  • VMReplication

示例

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