- Move machine to another hyper-v host via Failover Cluster Manager Console
- Get ID of duplicated VM
1Get-SCVirtualMachine -Name "VMName" |fl id,vmid, virtualmachinestate, hostname - Double check working and duplicated machine
1get-vm -id "ID" | fl id,vmid, virtualmachinestate, hostname - Delete duplicated VM configuration
1get-vm -id "ID" |Remove-SCVirtualMachine -Force
Note the -Force option! You are risking to delete your data If you do NOT put -Force.
thank you . good stuff. helped me removed a orphaned VM.
Do you need Hyper-V installed on the VMM server? I run the commands from my vmm server but on step 3 I get the error The Hyper-V role is not installed on the destination host. Thanks
I don’t think that you need Hyper-v role installed on the VMM machine. In fact notes are taken from a VMM running as a virtual machine.
Thank you. Had a look again this morning, and a slight error in my syntax. But all working now.
Wow, this actually fixed the issue, Nice one, Thanks
Put status to command
get-SCVirtualMachine -Name “VMName” |fl id,vmid, virtualmachinestate, hostname, status
If you have replication and getting Missing status in VMM console, missing is the machine you will delete. Both machines are in the Stopped virtualmachinestate but one, or more, is usualy missing.
Then proceed with others commands