Removing a VHD From A VM Using The Hyper-V WMI V2 Namespace

What good would Attaching a VHD To A VM Using The Hyper-V WMI V2 Namespace be if you couldn’t remove one two… Here’s how you do it.   Removing a virtual hard disk $vmName = “Test” $vhdPath = “d:\vms\Test.vhdx” #Retrieve the Hyper-V Management Service, ComputerSystem class for the VM and the VM’s SettingData class. $Msvm_VirtualSystemManagementService…

1

Attaching a VHD To A VM Using The Hyper-V WMI V2 Namespace

Relating to all my recent posts on the WMI V2 namespace here’s another one for attaching a VHD to a VM.  It looks like a lot of code but a lot of it is duplicated (so if you where writing an application you can factor it pretty easily).  There are effectively two steps to this…

7

Removing a Network Adapter To A VM Using The Hyper-V WMI V2 Namespace

Relating to my previous posts regarding Adding a Network Adapter To A VM Using The Hyper-V WMI V2 Namespace and Connecting a VM Network Adapter To A Switch Using The Hyper-V WMI V2 Namespace I had some questions come in around removing a NIC.  So here’s a sample – it’s pretty simple…   Removing a…

0

Changing The MAC Address Of NIC Using The Hyper-V WMI V2 Namespace

Relating to my previous posts regarding Adding a Network Adapter To A VM Using The Hyper-V WMI V2 Namespace and Connecting a VM Network Adapter To A Switch Using The Hyper-V WMI V2 Namespace I had some questions come in around configuring static vs dynamic MAC addresses.  So here’s some samples – you will notice…

1