Hey all,
I got a script that shows if a vm doesn't have tools installed or is not the most current. The only problem I have is it will report a VM even if it is shutdown showing the tools are not installed. Here is the script:
Get-View -ViewType VirtualMachine -Property Config.Template,Name,Guest.ToolsStatus -Filter @{
"Config.Template"="False";"Guest.ToolsStatus"="^(?!toolsOk$).*$" ;"Name"="^((?!_replica).)*$"} |
Select-Object Name,@{Name="ToolsStatus";E={$_.Guest.ToolsStatus}}
Thanks for any help on this,
Andy
Not sure if that is the question, but you can exclude powered off VMs with an additional filter condition.
Get-View -ViewType VirtualMachine -Property Config.Template,Name,Guest.ToolsStatus -Filter @{
"Config.Template"="False";"Guest.ToolsStatus"="^(?!toolsOk$).*$" ;"Name"="^((?!_replica).)*$"; "Runtime.PowerState"="poweredOn"} |
Select-Object Name,@{Name="ToolsStatus";E={$_.Guest.ToolsStatus}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Not sure if that is the question, but you can exclude powered off VMs with an additional filter condition.
Get-View -ViewType VirtualMachine -Property Config.Template,Name,Guest.ToolsStatus -Filter @{
"Config.Template"="False";"Guest.ToolsStatus"="^(?!toolsOk$).*$" ;"Name"="^((?!_replica).)*$"; "Runtime.PowerState"="poweredOn"} |
Select-Object Name,@{Name="ToolsStatus";E={$_.Guest.ToolsStatus}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference