VMware vSphere

 View Only
  • 1.  PowerCLI Command to view VM Attributes

    Posted Mar 18, 2019 02:49 AM

    Hi Guys,

    I need to view the Virtual machines in a cluster with following attributes in front of each VM. Kindly assist me on this.

    Virtual Machine name

    Power State

    CPU

    Memory

    Installed OS

    VMware Tools

    Hardware version



  • 2.  RE: PowerCLI Command to view VM Attributes

    Posted Mar 18, 2019 06:22 AM

    Hi Buddhika01

    You can select and changed columns you need it to show these attributes from vCenter

    Another way from RVTools download it and connect to your vCenter



  • 3.  RE: PowerCLI Command to view VM Attributes

    Posted Mar 18, 2019 06:24 AM

    Thanks for the reply, I am looking for powerCLI command or a script to retrieve the above mentioned columns.



  • 4.  RE: PowerCLI Command to view VM Attributes

    Posted Mar 18, 2019 06:31 AM

    It does not require powerCLI

    You can also retrieve the above columns of the two methods I mentioned to you

    Good luck



  • 5.  RE: PowerCLI Command to view VM Attributes
    Best Answer

    Posted Mar 18, 2019 11:49 AM

    Here you go

    Connect-VIServer -Server "vcenter Name or IP address"

    $Cluster= get-Cluster "Cluster Name"

    $vms = $cluster |Get-VM

    $output=""|Select Name, PowerState,CPU,Memory,InstalledOS,VMwareToolVersion,hardwareVersion

    foreach($vm in $vms)

    {

      $output.Name = $vm.Name

      $output.PowerState=$vm.PowerState

      $output.CPU= $vm.NumCPU

      $output.Memory= $vm.memoryGB

      $output.InstalledOS= ($vm|Get-view).Guest.GuestFullName

      

      $output.VMwareToolVersion= ($vm|Get-View).Guest.ToolsVersion

      $output.hardwareVersion=($vm|get-View).config.Version


      $output

      $output|Export-csv -Path C:\users\adm.jatin.purohit\desktop\VMReport.csv -Append -NoTypeInformation

    }



  • 6.  RE: PowerCLI Command to view VM Attributes

    Posted Mar 19, 2019 02:01 AM

    Hi thanks for the perfect reply. This is what i was looking for.