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
Here you go
$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
}
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
Thanks for the reply, I am looking for powerCLI command or a script to retrieve the above mentioned columns.
It does not require powerCLI
You can also retrieve the above columns of the two methods I mentioned to you
Good luck
Here you go
$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
}
Hi thanks for the perfect reply. This is what i was looking for.