Automation

 View Only
  • 1.  List vm off and date

    Posted Feb 17, 2022 11:24 PM

    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



  • 2.  RE: List vm off and date

    Posted Feb 18, 2022 06:52 AM

    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.