sivagndl
Enthusiast
Enthusiast

VM_Count for PowerCLI

Jump to solution

HI,

We required Info of Cluster Name, Host,version of host and VM's count of every host.

Thanks for Advance..

Regards,

Siva Reddy G

0 Kudos
1 Solution

Accepted Solutions
julienvarela
Commander
Commander

Hi,

You can try something like that :

$Audit = @()

$hosts = Get-Cluster [Cluster Name] | Get-vmhost

foreach ($esx in $hosts)

    {

    $vm= Get-vmhost $esx | get-vm

    $objGuest= "" | Select  Name ,Version, Count

    $objGuest.Name= $esx.Name

    $objGuest.Version = $esx.Version

    $objGuest.Count = $vm.Count

    $Audit += $objGuest

    }

$Audit

Regards,

Julien.

Regards, J.Varela http://vthink.fr

View solution in original post

0 Kudos
2 Replies
julienvarela
Commander
Commander

Hi,

You can try something like that :

$Audit = @()

$hosts = Get-Cluster [Cluster Name] | Get-vmhost

foreach ($esx in $hosts)

    {

    $vm= Get-vmhost $esx | get-vm

    $objGuest= "" | Select  Name ,Version, Count

    $objGuest.Name= $esx.Name

    $objGuest.Version = $esx.Version

    $objGuest.Count = $vm.Count

    $Audit += $objGuest

    }

$Audit

Regards,

Julien.

Regards, J.Varela http://vthink.fr
0 Kudos
sivagndl
Enthusiast
Enthusiast

Thanks a lot Chum.

0 Kudos