Translate

Tuesday, August 27, 2013

PowerCLI command to get VMware tools and VMware hardware version information

*Command to find out VMware tool status
*How to find out VMware tools status from Command / PowerCLI



It is easy to find VMware hardware version by using below command

Get-VM | Select name, Version | FT -AutoSize

As version is a root property of get-vm command.

However if we want to get VMware tool status, we need to deep dive into their extension property data and create a custom field as given below*

New-VIProperty -Name ToolsVersionStatus -ObjectType VirtualMachine -ValueFromExtensionProperty 'Guest.ToolsVersionStatus' -force

now rerun above command with ToolsVersionStatus

Get-VM | Select Name, Version, ToolsVersionStatus | FT -AutoSize




If you want to export it

Get-VM | Select Name, Version, ToolsVersionStatus | Export-Csv  -NoTypeInformation -UseCulture -Path c:\yourfile.csv




To get this information on Datacenter level

Get-Datacenter Datacentername | Get-VM | Select name, Version, ToolsVersionStatus | FT -AutoSize

To get this information on Cluster Level

Get-Cluster ClusterName | Get-VM | Select name, Version, ToolsVersionStatus | FT -AutoSize

To get this information on Host level

Get-VMHost hostname.domain | Get-VM | Select name, Version, ToolsVersionStatus | FT -AutoSize


*taken reference for this blog from blogs.vmware.com


Post your question and comment