VMware Cloud Community
EGS78
Enthusiast
Enthusiast
Jump to solution

Is there a way to know when a VM was restarted or turn off?

Hi,

Is there a way to know when a VM was restarted or turn off (can be Powershell)?

Thanks in advance

Eduardo.

0 Kudos
1 Solution

Accepted Solutions
virtualg_uk
Leadership
Leadership
Jump to solution

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:

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10190...

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


Graham | User Moderator | https://virtualg.uk

View solution in original post

0 Kudos
1 Reply
virtualg_uk
Leadership
Leadership
Jump to solution

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:

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10190...

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


Graham | User Moderator | https://virtualg.uk
0 Kudos