VMware Cloud Community
Guv
Enthusiast
Enthusiast

List out all domain controller VM's and there C drive space

I want to write a powershell script to get a list of all VM's in a virtual centre and list out their C drive size and how much space they have left in GB.   But i want to filter out the VM's by just displaying the domain controllers VM's.   All our domain controllers VM's have the letters 'dc' in them so can the VM's  be filtered with this in anyway.

Thanks

0 Kudos
1 Reply
LucD
Leadership
Leadership

You can start from something like this

Get-VM | Where {$_.Name -match "dc"} | Get-VMGuest | Select -ExpandProperty Disks


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos