Hi,
Is there a way to know when a VM was restarted or turn off (can be Powershell)?
Thanks in advance
Eduardo.
I wont reinvent the wheel as there is a very good article here which will explain the various ways to power off a VM and how to check what triggered it:
If you want to use PowerCLI, this line may help, it looks through the Events from vCenter Server and finds powered off events for the VM. I cannot remember if this shows powered off events from within the OS though.
Get-VIEvent -Entity THE-VM-NAME | Where-Object { $_.GetType().Name -eq "VmPoweredOffEvent" }
I hope this answers your question
I wont reinvent the wheel as there is a very good article here which will explain the various ways to power off a VM and how to check what triggered it:
If you want to use PowerCLI, this line may help, it looks through the Events from vCenter Server and finds powered off events for the VM. I cannot remember if this shows powered off events from within the OS though.
Get-VIEvent -Entity THE-VM-NAME | Where-Object { $_.GetType().Name -eq "VmPoweredOffEvent" }
I hope this answers your question