Hyper-V WMI: Creating a thumbnail image

Hyper-V has a WMI API that will allow you to create a thumbnail image of any running or paused virtual machine.  You can create any sized thumbnail you want (640x480, 800x600, 1024x768 etc…).  Creating the image is pretty easy, you just call GetVirtualSystemThumbnailImage passing a reference to an Msvm_VirutalSystemSettingData instance and the size of the […]

Hyper-V has a WMI API that will allow you to create a thumbnail image of any running or paused virtual machine.  You can create any sized thumbnail you want (640x480, 800x600, 1024x768 etc…).  Creating the image is pretty easy, you just call GetVirtualSystemThumbnailImage passing a reference to an Msvm_VirutalSystemSettingData instance and the size of the image you want…  However getting something useful from the returned data is a bit tricky…  You get an array of unit8’s that represent pixels, the API doesn’t have much choice and luckily Powershell makes this not an impossible feat.  All you have to do is create a new bitmap object and read (marshal) the pixel data into the object.

Full Article