Automation

 View Only
  • 1.  PowerCLI cmdlet to count the shutdown duration

    Posted Jun 18, 2013 08:53 PM

    Hi,

    is there any cmdlet/any other way, so that I can count the number of days since when a VM is shutdown, via powerCLI.

    e.g. to get a list of all the VMs which are powered-off since more than 30 days.


    Thanks for any help!!

    Regards

    Ashish



  • 2.  RE: PowerCLI cmdlet to count the shutdown duration

    Posted Jun 19, 2013 05:22 AM

    There is no cmdlet for that, but you can use the Tasks and Events that are kept on vCenter.

    To access those you use the Get-VIEvent cmdlet.

    You can also have a look at my Get-VIEventPlus function in my Get the vMotion/svMotion history post.

    In my HA VM failover tracking post I explain how to find the available eventtypes.

    In this case you will want to fetch the VmPoweredOffEvent event