How To Grab All VMs in Hyper-V / Cluster and their disks sizes

Change the exported path file.

Get-VM -ComputerName SERVER1,SERVER2,SERVER3 | ForEach-Object {Get-VHD -ComputerName $_.ComputerName -VMId $_.VMId} | ConvertTo-HTML -Property path,computername,vhdtype,@{label='Size(GB)';expression={$_.size/1gb -as [int]}},@{label='FileSize(GB)';expression={$_.filesize/1gb -as [int]}} > C:\Install\VHDxUsageReport.html

Size: Alocated VM disk.

FileSize: Current VM Disk usage.

Leave a Reply

Your email address will not be published. Required fields are marked *