The following Hyper-V PowerShell cmdlets apply to Hyper-V Replica.   **

</tbody> </table>
**Cmdlet** **Complete-VMFailover**
**Description** This cmdlet completes the Failover process of the virtual machine. The virtual machine’s current recovery point is committed and all other recovery points are removed. Failover cannot be cancelled once the recovery points are removed.
**Verb-Noun** Complete-VMFailover
**Syntax** Complete-VMFailover [-VMName] [-ComputerName <String[]>] [-PassThru] </td> </tr>
**Example** _Complete-VMFailover -VMName C0-FIN-FS1_
**Cmdlet** **Get-VMNetworkAdapterFailoverConfiguration**
**Description** Retrieves the Failover IP settings on a virtual machine network adaptor.
**Verb-Noun** Get-VMNetworkAdapterFailoverConfiguration
**Syntax** Get-VMNetworkAdapterFailoverConfiguration [-VMName] <String[]> [[-VMNetworkAdapterName] <String[]>] [-ComputerName <String[]>]
**Example**   ![cmd1](/assets/images/posts/2013/02/cmd1.png)
</tbody> </table>
**Cmdlet** **Get-VMReplication**
**Description** Retrieve the replication relationship information of one or more virtual machines.
**Verb-Noun** Get-VMReplication
**Syntax** Get-VMReplication [[-VMName] <String[]>] [-ComputerName <String[]>] [-ReplicaServerName ] [-PrimaryServerName ] [-State ] [-ReplicationTag ] </td> </tr>
**Example**   ![cmd2](/assets/images/posts/2013/02/cmd2.png)
</tbody> </table>
**Cmdlet** **Get-VMReplicationAuthorizationEntry**
**Description** This cmdlet returns the details of an authorization entry as identified by the input parameter. The possible ways to get a particular authorization entry is by using AllowedPrimaryServer, or security tag.
**Verb-Noun** Get-VMReplicationAuthorizationEntry
**Syntax** Get-VMReplicationAuthorizationEntry [[-AllowedPrimaryServer] ] [-ComputerName <String[]>] [-ReplicaStorageLocation <String </td> </tr>
**Example** _Get-VMReplicationAuthorizationEntry -AllowedPrimaryServer hyp3.contoso.local -ReplicaStorageLocation e:\VirtualMachines -SecurityTag CONTOSO_
**Cmdlet** **Get-VMReplicationServer**
**Description** This cmdlet retrieves the replication settings of the Replica server. If the server has not been configured as replica server, then the command returns default object.
**Verb-Noun** Get-VMReplicationServer
**Syntax** Get-VMReplicationServer [[-ComputerName] <String[]>]
**Example**   ![cmd3](/assets/images/posts/2013/02/cmd3.png)
</tbody> </table>
**Cmdlet** **Import-VMInitialReplication**
**Description** This cmdlet is used on the replica server to import the IR files transferred by admin using external media. The IR files are expected to be accessible using the specified path.
**Verb-Noun** Import-VMInitialReplication
**Syntax** Import-VMInitialReplication [-VMName] [-ComputerName <String[]>] [-Path] [-PassThru] [-AsJob] </td> </tr>
**Example** _Import-VMInitialReplication -VMName CO-LEGAL-FS11 -Path I:\Replicas\CO-LEGAL-FS11_B410F33F-55E1-44CB-A81F-6D60F408A756_
</tbody> </table>
**Cmdlet** **Measure-VMReplication**
**Description** This cmdlets gets the statistics of VMReplication.
**Verb-Noun** Measure-VMReplication
**Syntax** Measure-VMReplication [[-VMName] <String[]>] [-ReplicaServerName ] [-ComputerName <String[]>] [-ReplicationTag ] [-State ] [-PrimaryServerName ] </td> </tr>
**Example**   ![cmd4](/assets/images/posts/2013/02/cmd4.png)
</tbody> </table>
**Cmdlet** **New-VMReplicationAuthorizationEntry**
**Description** This cmdlet creates a new authorization entry for the recovery server. The authorization entry consists of the following - AllowedPrimaryServer, ReplicaStorageLocation, KeepPrimaryStorageLocation, and SecurityTag
**Verb-Noun** New-VMReplicationAuthorizationEntry
**Syntax** New-VMReplicationAuthorizationEntry -KeepPrimaryStorageLocation [-AllowedPrimaryServer] [-ComputerName <String[]>] </td> </tr>
**Example** _New-VMReplicationAuthorizationEntry hyp3.contoso.local -ReplicaStorageLocation d:\ReplicaStorage DEFAULT_
</tbody> </table>
**Cmdlet** **Remove-VMReplication**
**Description** This cmdlet is used to remove the replication relationship of a virtual machine. Replication relationship should be individually removed from both primary and replica virtual machines.
**Verb-Noun** Remove-VMReplication
**Syntax** Remove-VMReplication [-VMName] [-ComputerName <String[]>] [-PassThru] </td> </tr>
**Example** _Remove-VMReplication -VMName CO-FIN1-FS1_
</tbody> </table>
**Cmdlet** **Remove-VMReplicationAuthorizationEntry**
**Description** This cmdlet enables the admin to remove an authorization entry from the Replica server, rescinding authorization of replication attempts made against the primary server associated with the entry.
**Verb-Noun** Remove-VMReplicationAuthorizationEntry
**Syntax** Remove-VMReplicationAuthorizationEntry [-AllowedPrimaryServer] [-ComputerName <String[]>] [-PassThru] </td> </tr>
**Example** _Remove-VMReplicationAuthorizationEntry -AllowedPrimaryServer hyp3.contoso.local_
**Cmdlet** **Reset-VMReplicationStatistics**
**Description** This cmdlet resets all the replication statistics for a specific virtual machine.  These statistics can be retrieved using the Measure-VMReplication cmdlet.
**Verb-Noun** Reset-VMReplicationStatistics
**Syntax** Reset-VMReplicationStatistics [-VMName] <string[]> [-PassThru] [-ComputerName <string[]>] [-WhatIf] [-Confirm]
**Example** _Reset-VMReplicationStatistics -VMName Contoso-Print1_
</tbody> </table>
**Cmdlet** **Resume-VMReplication**
**Description** This cmdlet is used to resume replication of the virtual machine that is passed as input and are paused currently OR used to start resynchronization for a suspended/critical state virtual machine.
**Verb-Noun** Resume-VMReplication
**Syntax** Resume-VMReplication [-VMName] [-ComputerName <String[]>] [-ResynchonizeStartTime ] [-Resynchronize] [-PassThru] </td> </tr>
**Example** _Resume-VMReplication -VMName CO-EXEC-DATA1_
</tbody> </table>
**Cmdlet** **Set-VMNetworkAdapterFailoverConfiguration**
**Description** Configures the Failover IP settings for the n/w adapter. These IP settings will be applied to the virtual machines’s operating system whenever the virtual machines is started as part of failover.
**Verb-Noun** Set-VMNetworkAdapterFailoverConfiguration
**Syntax** Set-VMNetworkAdapterFailoverConfiguration [-VMName] <String[]> [[-VMNetworkAdapterName] <String[]>] [-ComputerName <String[]>] [-IPv6SubnetPrefixLength ] [-IPv6Address ] [-IPv6DefaultGateway ] [-IPv6AlternateDNSServer ] [-IPv6PreferredDNSServer ] [-IPv4SubnetMask ] [-IPv4Address ] [-IPv4DefaultGateway ] [-IPv4AlternateDNSServer ] [-IPv4PreferredDNSServer ] </td> </tr>
**Example** A good example would be to use another Hyper-V cmdlet (Get-VMNetworkAdapter) to get the adapter and then make the setting changes - _Get-VMNetworkAdapter -VMName CO-EXEC-DATA1 | Set-VMNetworkAdapterFailoverConfiguration -IPv4Address 1.53.0.170 -IPv4SubnetMask 255.0.0.0 -IPv4DefaultGateway 1.0.0.3 -IPv4PreferredDNSServer 1.53.0.191_
</tbody> </table>
**Cmdlet** **Set-VMReplication**
**Description** This cmdlet configures the replication relationship for a virtual machine. If the virtual machine is already configured for replication, it modifies the replication relationship of the virtual machine.
**Verb-Noun** Set-VMReplication
**Syntax** Set-VMReplication [-VMName] [-ComputerName <String[]>] [[-ReplicaServerName] ] [[-ReplicaServerPort] ] [[-AuthenticationType] ] [-AsJob] [-PassThru] [-Reverse] [-AutoResynchronizeIntervalStart ] [-AutoResynchronizeIntervalEnd ] [-InitialReplicationStartTime ] [-AsReplica] [-RecoveryHistory ] [-ExcludedVhdPath <String[]>] [-ExcludedVhd <Microsoft.Vhd.PowerShell.VirtualHardDisk[]>] [-CertificateThumbprint ] [-CompressionEnabled] [-ApplicationConsistentSnapshotFrequency ] [-DisableAppConsistentReplication] [-AutoResynchronizeEnabled] </td> </tr>
**Example** _Set-VMReplication -VMName CO-FIN-FS1 -ReplicaServerName hyp3.contoso.com -ReplicaServerPort 8080 -AuthenticationType Integrated -CompressionEnabled 1 -RecoveryHistory 0_
</tbody> </table>
**Cmdlet** **Set-VMReplicationAuthorizationEntry**
**Description** This cmdlet edits an existing authorization entry for the Replica server. This cmdlet can be used to modify the following - ReplicaStorageLocation,  KeepPrimaryStorageLocation, and SecurityTag for an existing "AllowedPrimaryServer".
**Verb-Noun** Set-VMReplicationAuthorizationEntry
**Syntax** Set-VMReplicationAuthorizationEntry [-AllowedPrimaryServer] [[-ReplicaStorageLocation] ] [-KeepPrimaryStorageLocation] [-ComputerName <String[]>] [-PassThru] </td> </tr>
**Example** _Set-VMReplicationAuthorizationEntry -AllowedPrimaryServer hyp3.contoso.local -ReplicaStorageLocation d:\ReplicaStorage_
</tbody> </table>
**Cmdlet** **Set-VMReplicationServer**
**Description** This cmdlet is used to provision the replica server, including specification of server authentication and the default storage location to be used. Multiple types of authentication could be allowed for the replica server. If certificate based authorization is chosen, then the certificate thumbprint is required.  You can also choose to enable replication from any servers thereby adding a * entry in the Authorization list
**Verb-Noun** Set-VMReplicationServer
**Syntax** Set-VMReplicationServer [-KeepPrimaryStorageLocation] [-ReplicationEnabled] [[-AllowedAuthenticationType] ] [-ReplicationAllowedFromAnyServer] [-ComputerName <String[]>] [-MonitoringStartTime ] [-MonitotingInterval ] [-CertificateAuthenticationPort ] [-CertificateThumbprint ] [-PassThru] [-IntegratedAuthenticationPort ] </td> </tr>
**Example** _Set-VMReplicationServer -ReplicationEnabled 1 -AllowedAuthenticationType Integrated -IntegratedAuthenticationPort 8080 -DefaultStorageLocation d:RecoveryData  -ReplicationAllowedFromAnyServer 1_
</tbody> </table>
**Cmdlet** **Start-VMFailover**
**Description** This cmdlet is used in multiple contexts - **Planned Failover**, **Failover**, and **Test Failover**.
**Verb-Noun** Start-VMFailover
**Syntax** Start-VMFailover [-VMName] [-Prepare] [-ComputerName <String[]>] [-PassThru] [-AsJob] Start-VMFailover [-VMName] [-VMRecoverySnapshot]  [-Prepare] [-PassThru] [-AsJob] Start-VMFailover [-VMName] [-ComputerName <String[]>] [-PassThru] [-Prepare] [-AsJob] [-AsTest] </td> </tr>
**Example** **Planned Failover** Planned Failover is a workflow, and requires a series of cmdlets to be run in a particular order. Some cmdlets need to be run on the primary server, while others on the Replica server. Run the cmdlets in the following order: 1. **1.     **On the primary server:**** 1. **a.      **_Stop-VM –VMName CO-FIN-FS1_ (Shuts down the VM)**** 2. _New-VMReplicationAuthorizationEntry hyp3.contoso.com -ReplicaStorageLocation d:\ReplicaStorage DEFAULT _(Ensure current primary server/cluster allows current replica server/cluster to replicate. If the current primary server already authorizes the current replica server to send replication data, then this step (1b) can be skipped) 3. _Start-VMFailover -VMName CO-FIN-FS1 –prepare _(Replicates any unreplicated changes) 2. On the Replica server: 1. _Start-VMFailover -VMName CO-FIN-FS1 _(Fails over the VM) 2. _Start-VMFailover -VMName CO-FIN-FS1 –reverse _(Resumes the replication in the reverse direction) 3. _Start-VM –VMName CO-FIN-FS1 _(Starts the VM) **Failover** _Start-VMFailover -VMName CO-FIN-FS1 -VMRecoverySnapshot_ **Test Failover** _Start-VMFailover -VMName CO-FIN-FS1 -AsTest_
</tbody> </table>
**Cmdlet** **Start-VMInitialReplication**
**Description** This cmdlet is used to start initial replication of the virtual machine. This cmdlet serves 3 purposes - a. Starts Initial replication and Delta replication at the end of IR. b. Starts initial replication if the Initial replication was cancelled manually by an administrator c. Starts initial replication if the replication stopped due to some unrecoverable failure
**Verb-Noun** Start-VMInitialReplication
**Syntax** Start-VMInitialReplication [-VMName] [-ComputerName <String[]>] [-PassThru] [-DestinationPath ] [-AsJob] </td> </tr>
**Example** Online initial replication: _Start-VMInitialReplication –VMName CO-FIN-FS1_ Initial replication using external media: _Start-VMInitialReplication –VMName CO-FIN-FS1 –DestinationPath “F:\ExportData”_ Initial replication seeding from backup copy on Replica server On Replica server _Set-VMReplication VM01 –AsReplica –AllowedPrimaryServer hyp3.contoso.local _ On primary server _Start-VMInitialReplication –VMName CO-FIN-FS1 -UseBackup_
</tbody> </table>
**Cmdlet** **Stop-VMFailover**
**Description** This cmdlet allows the admin to cancel the ongoing failover of a virtual machine or the test failover for the virtual machine.
**Verb-Noun** Stop-VMFailover
**Syntax** Stop-VMFailover [-VMName] [-ComputerName <String[]>] [-PassThru] </td> </tr>
**Example** _Stop-VMFailover –VMName CO-FIN-FS1_
</tbody> </table>
**Cmdlet** **Stop-VMInitialReplication**
**Description** This cmdlet is used to cancel the online Initial Replication that is going on. This cmdlet can also be used to cancel the ongoing export/import of OOB IR.
**Verb-Noun** Stop-VMInitialReplication
**Syntax** Stop-VMInitialReplication [-VMName] [-ComputerName <String[]>] [-PassThru] </td> </tr>
**Example** _Stop-VMInitialReplication -VMName CO-FIN-FS1_
</tbody> </table>
**Cmdlet** **Stop-VMReplication**
**Description** This cmdlet is used to cancel the resync Replication that is going on.
**Verb-Noun** Stop-VMReplication
**Syntax** Stop-VMReplication [-VMName] [-ComputerName <String[]>] [-PassThru] </td> </tr>
**Example** _Stop-VMReplication -VMName CO-FIN-FS1_
</tbody> </table> Cheers, **Marcos Nogueira** [azurecentric.com](http://azurecentric.com) Twitter: [@mdnoga](http://www.twitter.com/mdnoga)
**Cmdlet** **Suspend-VMReplication**
**Description** This cmdlet pauses replication in the virtual machine that is passed as input.
**Verb-Noun** Suspend-VMReplication
**Syntax** Suspend-VMReplication [-VMName] [-ComputerName <String[]>] [-PassThru] </td> </tr>
**Example** _Suspend-VMReplication -VMName CO-EXEC-DATA1_