VMware Cloud Community
PMPM789
Enthusiast
Enthusiast
Jump to solution

Find the VM tools status

Hello Guys

i am looking for script which can send daily with VMware tools info ( current/up to date,out dated,3rd party etc) .Is it possible ? if yes ,any help would appreciated.

(i have 9 vCenters and 6000+ VMs )

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You could run something like this

$report = Get-View -ViewType VirtualMachine -Property Name,Guest |

Select Name,@{N='ToolsStatus';E={$_.Guest.ToolsStatus}},

    @{N='ToolsType';E={$_.Guest.ToolsInstallType}},

    @{N='ToolsVersion';E={$_.Guest.ToolsVersion}},

    @{N='ToolsRunningStatus';E={$_.Guest.ToolsRunningStatus}},

    @{N='vCenter';E={([uri]$_.Client.ServiceUrl).Host}} |

Sort-Object -Property Name


$sMail = @{

    To = 'me@domain'

    From = 'report@domain'

    Subject = 'VM Tools Report'

    Body = $report | ConvertTo-Html | Out-String

    BodyAsHtml = $true

    SmtpServer = 'mail.domain'

}

Send-MailMessage @sMail


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

How, and from where, do you intend to schedule the script?

In Windows Task Scheduler?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
PMPM789
Enthusiast
Enthusiast
Jump to solution

what i need is pull the report from vCenters and send report  to my email .

All my vCenters are appliances . So i can schedule job from my jump server(windows) if need

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You could run something like this

$report = Get-View -ViewType VirtualMachine -Property Name,Guest |

Select Name,@{N='ToolsStatus';E={$_.Guest.ToolsStatus}},

    @{N='ToolsType';E={$_.Guest.ToolsInstallType}},

    @{N='ToolsVersion';E={$_.Guest.ToolsVersion}},

    @{N='ToolsRunningStatus';E={$_.Guest.ToolsRunningStatus}},

    @{N='vCenter';E={([uri]$_.Client.ServiceUrl).Host}} |

Sort-Object -Property Name


$sMail = @{

    To = 'me@domain'

    From = 'report@domain'

    Subject = 'VM Tools Report'

    Body = $report | ConvertTo-Html | Out-String

    BodyAsHtml = $true

    SmtpServer = 'mail.domain'

}

Send-MailMessage @sMail


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos