Hyper-V replication remove Disk

Hyper-V 2019, Server 2019

VM has four VHDXs. Need to remove two from replication.

Compiled statement:

Set-VMreplication “Server” -ReplicatedDisks (Get-VMHardDiskDrive “Server” -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 2).

This will remove Disks from ControllerLocation 0,1,3 But I need to remove from 1 too.

How would I construct it?

Confused, can you make this lil more clear ?

Hi Karunan,

I was trying to figure out commands to replicate only certain disks after replication is enabled without breaking it.

Figured it out.

Command that I used:

Set-VMreplication “VMname” -ReplicatedDisks (Get-VMHardDiskDrive “VMname” -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0), (Get-VMHardDiskDrive “VMname” -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 2)

So to replicate all disks - Set-VMreplication “VMname” -ReplicatedDisks (Get-VMHardDiskDrive “VMname”)

To replicate only certain disks - add (Get-VMHardDiskDrive “VMname” -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0) and repeat same line for each disk, changing the location or type or controller depending on your situation. Put a comma between each parantasy.

Sorry if it’s not clear.