Getting all Snapshots with Powershell

Every vSphere Admin knows, that if you give someone in your organization the rights to take snapshots, you will lose the control of them.

Often they forget to delete the snapshot after their maintenance. So the snapshots gets bigger and bigger. The results are full datastores, big snapshots that can’t be no-more deleted and in the worst case you will have corrupted VM.

To counter against those problems, I’ve wrote a Powershell script that gets all snapshots in your environment and sends you an email with the name, size, time and the description of the snapshots.

You just have to edit the global variables with yours and then schedule the script.

After this, you can control your snapshots much more better.

Feel free to use, edit and share it:

4 thoughts on “Getting all Snapshots with Powershell”

  1. Hi Bruno,
    thanks for your work.

    would you mind sharing with us re running it from, vcentre server, esxi?
    thanks

    1. I have made a scheduled task on the vcenter that runs this script once a week.
      Dont know if this is really what you are asking for 🙂

  2. all good, seems to be working except i am getting email with those info:

    TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;}TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;}
    VM Created SizeInGB Name Description

    1. This is the HTML format of the email. Do you have disabled html mails on your mail server or on your mail client?

Leave a Reply

Your email address will not be published. Required fields are marked *