ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Powershell/VMWARE Snapshot Cleanup

    Scheduled Pinned Locked Moved IT Discussion
    powershellvmwaresnapshots
    1 Posts 1 Posters 361 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dafyreD
      dafyre
      last edited by dafyre

      Hi All,

      I saw another post about Powershell and VMware and figured I'd post this script I've been using to manage snapshots. https://gitlab.com/dafyre/powershell-utils/-/blob/master/VMware/snapshotCleanup.ps1

      If you're like us, we have timed snapshots on everything, so that every day/weeek/month a snapshot is run on various systems. The daily ones area PITA to clean up -- especially for a lot of machines.

      This script will connect to your vCenter (or VMware host) and and cleanup the snapshots you specify. It's easier done if you have your snapshots setup with something like "Daily Snapshot of blahblah" in the name.

      If run without parameters, it will prompt you for your vmware server name and credentials, and then list all snapshots that have "Daily Snapshot" in the name and are older than 8 days.
      . Run with the -liverun parameter, it will actually remove the snapshots for you.

      If there's any questions / comments / ideas for improvement, I'm all ears.

      1 Reply Last reply Reply Quote 3
      • 1 / 1
      • First post
        Last post