Quantcast
Channel: VMware Communities : Blog List - All Communities
Viewing all articles
Browse latest Browse all 3135

List thin vdisks using powershell/powercli in ESXi

$
0
0

Hi,

in order to list all the thin vdisks of your vmware infrastructure, a small powershell/powercli like this can be used:

 

$allvms = Get-VM | where-object {($_.powerstate -ne "PoweredOff")}

foreach ($vm in $allvms | Get-View){

  foreach($dev in $vm.Config.Hardware.Device) {

    if(($dev.GetType()).Name -eq "VirtualDisk") {

      if($dev.Backing.ThinProvisioned -eq $true) {

        $vm.Name + "`t" + $dev.Backing.FileName

            }   

        }

     }

}

 

(As usual, remember to use the Connect-VIServer cmdlet before!)

 

 

I would like to comment that this script is mainly taken from here.

 

 

Best regards,

Pablo


Viewing all articles
Browse latest Browse all 3135

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>