All posts tagged: Hyper-V WMI

Hyper-V: VHD Shell Extensions, updated release

I just posted a batch file wrapper around VHD Shell Extensions to find stale VHDs on a Hyper-V Server. However, because of VHDShellExt.vbs design, it will always try to find if the given VHD is associated with a VM on the local Hyper-V machine. One problem with this design is, you need to use the script on all the Hyper-V server machines you have to find any stale VHDs.  I have updated VHDShellExt.vbs to add /Server switch to be able to use it from a non Hyper-V system too. Now, using this new switch you can use the script from even a Windows Server 2003 or Windows XP system.  You can download the new release here Here is the updated documentation for this release

One more release of HVS 2008 UI to end the year

It has been a great year so far. I have really enjoyed working on quite a few interesting things including the HVS2008 UI project. I just made another release of this tool on codeplex. You can download it at I have fixed a couple of bugs I found and added Snapshot management / Backup features. Snapshot management includes creating/deleting/Listing/Applying snapshots. These are available under “Virtual Machine Activities”. Backup has been added to “Misc activities” menu option. You will be able to set a default backup device and/or perform backup to a different backup device. All it does is basically copy all VM/VHD files to the specified backup location. I haven’t added automatic shutdown / restart of VMs before / after backup operation. I have left this intentionally because ShutdownComponent is the only safe way of shutting down VMs and it works only if ICs are installed in the Guest OS. It is not necessary that all your VMs have ICs installed. This drives for lot of scripting and I thought it is not an immediate …

VHDMOUNT for Hyper-V – Updated Scripts

I just posted an issue with old VHDMOUNT scripts I created. As mentioned in the earlier post, this issue was caused because of an update to GetVirtualHardDiskInfo method output format. You can download an updated version of this script here. You will have to unzip all the files in to a single folder and then import HV-Reg.reg in to your registry. You may have to change the script path in the registry file based on where you have unzipped these files.

Changes to GetVirtualDiskInfo() Method

It has been a while since I used the script written for mouting VHDs. I started re-writing the code for mouting/unmount VHDs for the Codeplex project and realized that MS changed the output format for this method. Earlier this method used to return a string similar to instance of Msvm_VirtualHardDiskInfo {Type = 3;FileSize = 2405406208;MaxInternalSize = 32212254720;InSavedState = TRUE;InUse = FALSE;}; But now, they have converted the output to XML format. It looks something like <INSTANCE CLASSNAME=”Msvm_VirtualHardDiskInfo”><PROPERTY NAME=”FileSize” TYPE=”uint64″> <VALUE>10514432</VALUE> </PROPERTY> <PROPERTY NAME=”InSavedState” TYPE=”boolean”> <VALUE>FALSE</VALUE> </PROPERTY> <PROPERTY NAME=”InUse” TYPE=”boolean”> <VALUE>TRUE</VALUE> </PROPERTY> <PROPERTY NAME=”MaxInternalSize” TYPE=”uint64″> <VALUE>2147483648</VALUE> </PROPERTY> <PROPERTY NAME=”ParentPath” PROPAGATED=”true” TYPE=”string”> </PROPERTY> <PROPERTY NAME=”Type” TYPE=”uint16″> <VALUE>3</VALUE> </PROPERTY> </INSTANCE>. If you have downloaded the script earlier from this blog, it will work without any issues. However, the error checking capability of it is actually broken. For example, if you have mounted a VHD using the VHDmount.vbs and try to mount the same VHD again, you will get no error. I am fixing this and will release an updated script soon

codeplex project update

I have made an intermittent release on Codeplex. You can download it @ There are no major feature additions. I have modified the main menu display and bundled related activities in to a few categories to make sure I keep the main menu clean and small. Also, I am planning to release each feature in this tool as an individual script. This is to make sure the VBScripts are available for anyone who wants to use them irrespective of what SKU of Hyper-V they are running.

VBScript to change the default VHD / VM location

I have found numerous resources on the net to perform this using PowerShell scripting. However, doing the same in VBScript isn’t straight forward. I needed this piece of code for my HVS2008 UI project on Codeplex. I just worked on it and wanted to share the same here. You can download the script