VMware Cloud Community
Vimal348
Enthusiast
Enthusiast

VM Snapshot

Hello,

Can someone please help me on this:
https://packetlost.com/blog/2015/01/24/vmware-email-report-of-old-snapshots/

I need to collect the snapshot report which is older than 7 days and then send that to the email (I got the script from the above link (Thanks to them)). But here my condition is I dont want this to send email if any snaphosts are less than 7 days / no snapshots. 

In this script, it will send the email for sure even there is no snapshots or snaps less than 7 days with email body(There are no VMs with snapshots older than 7 days in this report).

So can someone please help me how to script it?

0 Kudos
1 Reply
LucD
Leadership
Leadership

Just remove the Else block from the last If in that script.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos