Method 1:
PowerCli Command
Get-VM | Where-Object {$_.ExtensionData.Guest.ToolsStatus -eq "toolsOld"}
Method2:
Rvtools
Use Rvtools to find what hosts don’t have tools installed or an in need of updating..
Other method: PowerCLI Script
I put it up because its good to decode code to understand powercli better
It does the same thing as method 1
#Description: This function checks for VMs with out-of-date VMware tools
#Purpose: Discovering VMs that require VMTools updated
#Designed to be added as function into $profile for quick-admin tasks, run from commandline
#Author: Kirk Munro, extracted from VMware powerpack: http://www.powergui.org/entry.jspaexternalID=1802&categoryID=290
#Tested with: ESX4.1
#Last edit by: MsMiller on 11/08/2011
function func_VMs_with_Out_of_Date_Tools()
{
$noConnection = $true
if ($defaultVIServers) {
foreach ($managedHost in $defaultVIServers) {
$noConnection = $false
Get-VM -Server $managedHost | Get-View | ForEach-Object {
if ($_.Guest.ToolsStatus -eq "ToolsOld"){
$_.PSObject.TypeNames.Insert(0,"$($_.PSObject.TypeNames[0])#VmwarePowerPackExtension")
$_ `
| Add-Member -MemberType NoteProperty -Name ToolsStatus -Value $_.Guest.ToolsStatus -PassThru `
| Add-Member -MemberType NoteProperty -Name ToolsVersion -Value $_.Guest.ToolsVersion -PassThru `
| Add-Member -MemberType NoteProperty -Name ManagedHost -Value $managedHost.Name -PassThru
}
}
}
}
if ($noConnection){
Show-MessageBox -Text 'You must connect to one or more vSphere servers before you can run the VMs with Out of Date Tools
best practice query on those servers. Please click on the ''Managed Hosts'' node, connect to one or more of the vSphere
servers you have configured there, and then try again.' -Caption 'Connection not established' -Buttons 'OK' -Icon
'Information' | Out-Null
}
}
func_VMs_with_Out_of_Date_Tools | Select-Object -property 'Name', 'ToolsStatus', 'ToolsVersion', 'ManagedHost'
*note:
VMware Tools do not always change significantly when the ESX build is updated and to avoid unnecessary virtual machine restarts the tools are only marked Out of Date when a major change has occurred.
0 comments:
Post a Comment