Hi,
We have had some issues with the hardware upgrades, I think, so I would like to run a report from VUM or otherwise to see which ones I upgraded. Any help would be appreciated!
Thanks
You can use:
Get-VM | Select-Object -Property Name,Version
to see the hardware versions of all your vm's.
Thanks, but I need to know which ones I upgraded over the past weekend...
I found this from LucD but there is a syntax error which I can't seem to fix:
$events = Get-VIEvent -Start (Get-Date).AddDays(-1) | ` where {$_.EventTypeId -like "com.vmware.vcIntegrity*"} | ` Sort-Object -Property CreatedTime $events | %{ New-Object PSObject -Property @{ Date = $_.CreatedTime User = $_.UserName Host = $_.Host.Name Message = $_.FullFormattedMessage } } | Export-Csv "C:\Update-Manager-report.csv" -NoTypeInformation -UseCulture
Error:
Does anyone know how to fix this? I am unclear as to what the & is doing...
Thanks
Which error message are you getting ?
Try something like this
&{Get-VIEvent -Start (Get-Date).AddDays(-1) |
where {$_.EventTypeId -like "com.vmware.vcIntegrity*"} |
Sort-Object -Property CreatedTime | %{ New-Object PSObject -Property @{ Date = $_.CreatedTime
User = $_.UserName
Host = $_.Host.Name
Message = $_.FullFormattedMessage
} }} | Export-Csv "C:\Update-Manager-report.csv" -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Probably something went wrong copying and pasting Luc's code. You need the replace all the " with double quotes. I modified Luc's code a little:
$events = Get-VIEvent -Start (Get-Date).AddDays(-1) | ` where {$_.GetType().Name -eq "VmUpgradingEvent" -or $_.GetType().Name -eq "VmUpgradeCompleteEvent"} | ` Sort-Object -Property CreatedTime $events | %{ New-Object PSObject -Property @{ Date = $_.CreatedTime User = $_.UserName Host = $_.Host.Name Message = $_.FullFormattedMessage } } | Export-Csv "C:\Update-Manager-report.csv" -NoTypeInformation -UseCulture
Thanks. In either script I come up with no results, even going back 4 days. I can see that there was an event of this type on December 1st.
"Initiated VMware Tools install or upgrade". Initiated by com.vmware.vcIntegrity.
In this case there was a status of "error", but I'm looking for any status...
VMware Tools upgrade is something different than a VM hardware upgrade. Which of the two are you searching for?
hardware
Then it looks like none of your hardware upgrades were even started in the last four days.