Miscellaneous script - Get-VMDiskMapping

Version 2

    Did you ever got a request to extend a disk on a VM?

    Most probably you were asked by the server administrator or dba to extend Windows disk number x

    Unfortunately this Windows disk number doesn't correspond to the virtual disk number of your VM.

    Finding out which virtual disk in the VM's settings corresponds to this Windows disk can be a cumbersome task.

    Especially when you have multiple SCSI controllers and/or many disks attached to your VM.


    This script matches Windows disks and their VMware virtual disk counterparts.

    It uses the Invoke-VMScript cmdlet to retrieve WMI information from the Windows guest, so there is no network connection needed to the VM.

    This makes the script suitable for isolated guests too (Internal only network, DMZ, or otherwise seperated by firewall).


    Multiple vCenter- or ESX(i)-servers can be added to the $VCServerList array, so there's no need to know which host or vCenter manages your VM.









    More info on the Get-VMDiskMapping script and also a VESI/PowerGUI PowerPack version can be found here:




    More info on retrieving WMI info using Invoke-VMScript cmdlet:




    Screenshot from the PowerPack version: