PowerCLI – How to get Vmware tools version
Get vmtools version for all VMs
get-vm | % {get-view $_.id} | select Name,@{Name="Tools Version"; Expression={$_.Config.tools.toolsversion}}, @{ Name="Tool Status"; Expression={$_.Guest.ToolsVersionStatus}}
Get vmtools version for all VMs from a cluster
get-cluster -Name ClusterName | get-vm | % {get-view $_.id} | select Name, @{Name="Tools Version";
Expression={$_.Config.tools.toolsversion}}, @{ Name="Tool Status"; Expression={$_.Guest.ToolsVersionStatus}}
Get vmtools version for all powered on VMs
get-vm | where {$_.powerstate -eq "PoweredOn"} | % {get-view $_.id} | select Name, @{Name="Tools Version";
Expression={$_.Config.tools.toolsversion}}, @{ Name="Tool Status"; Expression={$_.Guest.ToolsVersionStatus}}
List all VMs with out of date vmtools
get-vm | where {$_.Guest.ToolsVersionStatus -ne "guestToolsCurrent"} | % {get-view $_.id} | select Name, @{Name="Tools Version";
Expression={$_.Config.tools.toolsversion}}, @{ Name="Tool Status"; Expression={$_.Guest.ToolsVersionStatus}}
Get vmtools for all VMs with Microsoft operating system
get-cluster -Name ClusterName | get-vm
| % {get-view $_.id} | where {$_.config.guestfullname -like
"*Microsoft*"} | select Name, @{Name="OS Version";
Expression={$_.config.guestfullname}}, @{Name="Tools Version";
Expression={$_.Config.tools.toolsversion}}, @{Name="Tools Status";
Expression={$_.Guest.ToolsVersionStatus2}}
Get vmtools version for all VMs exported to csv file
get-vm | % {get-view $_.id} | select Name, @{Name="Tools Version";
Expression={$_.Config.tools.toolsversion}}, @{ Name="Tool Status"; Expression={$_.Guest.ToolsVersionStatus}} | Export-Csv -NoTypeInformation -UseCulture -Path C:\Tools\ToolsVersion.csv
No comments:
Post a Comment