Get The List of All VMs in Virtual Machine Manager and Their Virtual Disks #VMM #SCVMM #HyperV #PowerShell

This post was edited/updated on June 2, 2016.

(The update includes a new version of the PowerShell VMM Reporting Script that populate the percentage of the free disk space for all Virtual Machines, the script has been published to TechNet, you can find the link at the bottom of this post).

In today’s blog post I will show you how to get the list of all Virtual Machines in System Center Virtual Machine Manager including their virtual disks.

If you select any host managed by VMM and you look into one of the VM hardware configuration, you will see a similar figure as below:

Get-SCVMVirtualDisk-01

The most concern hardware configuration is the virtual hard disk of the VM such as type (dynamic, fix or differencing), Maximum disk size, the current disk space used, and the storage location.

The challenging question is, what if you have a large VMM deployment, and you want to track all virtual machines and enumerate their virtual disks?

Unfortunately SCVMM on it’s own doesn’t have any reporting capability to accomplish this task Sad smile

Luckily enough PowerShell will come to the rescue once again Smile

I have created the following tool that will help you to get the list of all VMs in VMM server Or all VMs in a particular VMM Host Group and enumerate all their virtual drives, and then send you a nice formatted email report Winking smile

Get-SCVMVirtualDisk-02

And here you go the report in your inbox.

Get-SCVMVirtualDisk02

A couple of areas that could definitely be improved though, would have to check the disk space used versus the maximum disk size, and then highlight the virtual disk that reaching its limits, etc…

You can download a copy of this tool from TechNet here.

This is version 3.0, do you want additional features? please feel free to leave a comment below.

Enjoy your day!

Cheers,
-Charbel

About Charbel Nemnom 298 Articles
Charbel Nemnom is a Microsoft Cloud Consultant and Technical Evangelist, totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 15 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.

4 Comments

  1. I am getting this error.

    PS C:\CloudPack\Scripts> ./Get-SCVMVirtualDisk -VMMServerName scvmm01.cbagroupcloud.com
    At C:\CloudPack\Scripts\Get-SCVMVirtualDisk.ps1:91 char:301
    + … $_.Size/1GB)}},,@{Label=”Free Disk Space (GB)”;Expression={“{0:N2}” -f (($_.Maxi …
    + ~
    Missing expression after ‘,’ in pipeline element.
    At C:\CloudPack\Scripts\Get-SCVMVirtualDisk.ps1:91 char:301
    + … $_.Size/1GB)}},,@{Label=”Free Disk Space (GB)”;Expression={“{0:N2}” -f (($_.Maxi …
    + ~
    Missing argument in parameter list.
    + CategoryInfo : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingExpression

Leave a Reply