Automation

 View Only
  • 1.  Can we get the Snapshot age ?

    Posted Apr 05, 2019 11:31 AM

    Hi All,

    Can we get the Snapshot age for more than 5 days ?

    thanks

    vmk



  • 2.  RE: Can we get the Snapshot age ?
    Best Answer

    Posted Apr 05, 2019 01:10 PM

    This will get snapshots older than 5 days:

    Get-VM | Get-Snapshot | Where {$_.Created -lt (Get-Date).AddDays(-5)}

    You might also want to take a look at Alan's snapshot reminder:

    http://www.virtu-al.net/2009/06/22/powercli-snapreminder/



  • 3.  RE: Can we get the Snapshot age ?

    Posted Apr 05, 2019 01:27 PM

    Thank you. Can we get the snapshot name,  Who created it  ?



  • 4.  RE: Can we get the Snapshot age ?

    Posted Apr 05, 2019 05:33 PM

    The name of the snapshot is in the first column of the output.  Who created it isn't a property of the snapshot, but you can get this if the task or event from the snapshot creation is still in the vCenter database.  The snapshot reminder script I referenced above does this or there is a module in the Powershell Gallery to get the creator:

    PowerShell Gallery | Functions/Get-SnapshotCreator.psm1 1.0