I was wondering how to check for who created a snapshot within pwercli. This is the only item I having an issue doing. I am extremely green in powercli and the only posts I see with it on the internet are way more complicated scripts than my powercli level.
Unfortunately, the information about the user who created a snapshot is not available in the object returned by Get-Snapshot.
The information is available (most of the time) in the events produced by the creation of a snapshot though.
The SnapReminder script from Alan contains a subroutine that scans the events and extracts the information about the user.
The problem with that subsroutime is the the timestamp.
There can be a time difference between the timestamp on the snapshot and the timestamp on the corresponding event. The SnapshotExtra function in Alan's script tries to compensate for that time difference, by looking at events that occurred 5 seconds before or after the snapshot timestamp.
Depending on the load of your vCenter, this will return the correct event (and hence user) that corresponds with the snapshot.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference