Tag Archives: VMware

Old Snapshots – PowerCLI Email Report

Whether your developers are keeping snapshots around for months or your backup program is leaving behind old snapshots due to backup failures, its always good to know about your aging snapshots.

Below is a script which will find all VMs with snapshots older than 7 days. As usual you can customize this to meet your needs, for me I like to keep transcripts and output files for archival and troubleshooting.

 

Virtual Machine Guest Disk Free Space – PowerCLI Email Report

I expanded upon a useful sharing from over at the VMware community site.

Below is some code you can use to run against vcenter to get an emailed report of all virtual machines with low free space. The VMs need to have vmware tools running for this report. Don’t worry, I’ll post a script to check on that too!

As a personal preference I like to create a service account with logon as batch rights on a system to run this script. I then provision this same service account with read only privileges to vCenter. Once those things are setup the powershell script can be ran from task scheduler (using least privileged, yay).

Another thing I like to do is to capture transcripts and outputs of any scripts I run. This way if I have an SMTP issue or lose the email, I can go back and check files to see what was in previous reports or any errors that the script encountered.

You will want to edit the vcenter server name, the output file path, and email addresses before using this script. The script will email any VMs with drives that have less than 10% free space, of course, you can customize that % as well.