Month: February 2013

Set (or inject) guest network configuration from Hyper-V host (Windows Server 2012)

Those of you who work(ed) on VMware ESX and use PowerCLI for ESX management would have – at some point in time – used the Set-VMGuestNetworkInterface cmdlet to set the IP address configuration of guest OS from the vCenter host or where you have PowerCLI installed. This is quite useful when performing automated guest OS installs and you want to be able to accurately set IP information for different network interfaces in the guest. In Hyper-V in Server 2008 R2, there were no interfaces to achieve something like this. However, as I’d mentioned in an earlier post, the updated WMI namespace in Hyper-V in Server 2012 provides a way to set the guest IP information from Hyper-V host. In a previous post, I showed you how to retrieve Hyper-V guest network configuration information using the updated WMI classes. In this post, we shall see how we can set the guest network information. We will use the new WMI class in Server 2012 Hyper-V WMI namespace – Msvm_GuestNetworkAdapterConfiguration. Make a note that this works only when …