VMware Cloud Community
pamiller21
Enthusiast
Enthusiast
Jump to solution

VMtools Report

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

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos