You could do something like this.
You want to change the $start value, depending on how far you want to look back.
$alarm = Get-AlarmDefinition -Name $alarmName
$start = (Get-Date).addHours(-1)
Get-VIEvent -Start $start -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMware.Vim.AlarmReconfiguredEvent] -and $_.Alarm.Alarm -eq $alarm.Id} |
Select @{N='Name';E={$_.Alarm.Name}},
@{N='Date';E={$_.CreatedTime}},
@{N='User';E={$_.UserName}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD
It did not retrieve anything but I found this older post and I got the result of what I was looking for with "@{N='Last Modified By';E={$alarm.ExtensionData.Info.LastModifiedUser}},"
Re: Export All Alarms and definitions from VCenter.
Thanks
That might indicate that you don't keep events for long enough on your vCenter to capture those changes.
But yes, that is another method to find the last user that changed an alarm.
If you want to see all users, you have to rely on the events.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference