4

In Hyper-V 2012 when we had the configuration of a vm in the xml format, one could look up the last_powered_off_time node in the vm's configuration .xml file:

<last_powered_off_time type="integer">131592348393627970"</last_powered_off_time>

and get this information easy. However, in the Windows 2016 Hyper-V vm configuration format changed to a binary file .vmcx. Even though I can read the properties with Compare-VM cmdlet I cannot see a property that stores the last powered off date like I could in Hyper-V 2012 XML file.

What options do I have to check when a vm was last powered off in the Hyper-V 2016?

  • did you try something like get-vm | fl *? i dont have hyper-v to test it out – 4c74356b41 Nov 26 '18 at 15:13
  • I did try, and Get-VM doesn't provide any information on when a vm was last powered off. – Oliver Nilsen Nov 27 '18 at 12:33
3

Since the new version of configuration files on Hyper-V doesn't have such option PowerShell will not give exact information either. Try MSVM_ComputerSystem class in order to get the last state change - https://docs.microsoft.com/ru-ru/previous-versions/windows/desktop/virtual/msvm-computersystem but it will also change during the bootup.

Microsoft releasing new WMI classes each major updates and you can check the needed class here - https://docs.microsoft.com/en-us/windows/desktop/hyperv_v2/what-s-new-in-hyper-v

  • 2
    Thx for feedback. Do you maybe have some examples on how to query info from SCVMM using WMI? – Oliver Nilsen Nov 29 '18 at 14:15

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.