Generate system uptime report of VMs using PowerCLI

It is possible to return the system uptime of your VMs by retrieving the last statistical information for the metric ‘sys.uptime.latest’ in realtime using PowerCLI. For Example, to return the metric for the virtual machine ‘VM1’ we could run the following command: Get-Stat -Entity VM1 -Stat sys.uptime.latest -Realtime -MaxSamples 1 This will return the uptime … More Generate system uptime report of VMs using PowerCLI

Create VM annotation based on deployed template name

I was recently looking to create a virtual machine annotation type to include the template name to which a virtual machine was deployed from. I was able to achieve this by using the Get-VIEvent cmdlet to return a match for a virtual machine where the event was equal to “VmBeingDeployedEvent” and formatting the output string … More Create VM annotation based on deployed template name