force remove hyperv to azure replication

Alex Kleeorin 61 Reputation points
2023-06-22T10:49:14.12+00:00

I am trying to remove a specific an old, failed replication from HYPERV to azure of a specific VM using this script

$vmName = "VMName"

$vm = Get-WmiObject -Namespace "root\virtualization\v2" -Query "Select * From Msvm_ComputerSystem Where ElementName = '$vmName'"

$replicationService = Get-WmiObject -Namespace "root\virtualization\v2" -Query "Select * From Msvm_ReplicationService"

$replicationService.RemoveReplicationRelationship($vm.__PATH)

however i get this error

Exception calling "RemoveReplicationRelationship" : "Invalid method Parameter(s)

any help will be gladly appreciated

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,799 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.