VMware Cloud Community
fborges555
Enthusiast
Enthusiast

List vm off and date

Gurus

 

I have the following

$vmoff = get-vm |Where-object {$_.powerstate -eq "poweredoff"}

 

but how do I go and get the date when they were  turn off

0 Kudos
1 Reply
LucD
Leadership
Leadership

By retrieving the VMPoweredOffEvent objects from the Event history with Get-VIEvent.
Provided your environment is configured to keep Events sufficiently long enough.

There are numerous examples in this community on that subject.


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

0 Kudos