VMware Cloud Community
vmk2014
Expert
Expert
Jump to solution

Can we get the Snapshot age ?

Hi All,

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

thanks

vmk

Tags (1)
1 Solution

Accepted Solutions
dtaliafe
Hot Shot
Hot Shot
Jump to solution

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/

View solution in original post

0 Kudos
3 Replies
dtaliafe
Hot Shot
Hot Shot
Jump to solution

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/

0 Kudos
vmk2014
Expert
Expert
Jump to solution

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

0 Kudos
dtaliafe
Hot Shot
Hot Shot
Jump to solution

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