It was the bane of my existence at one time. The priority one ticket, all the VM guest on a particular Datastore have paused themselves. What could it be, how could this have happened? It was always the same cause at one of my clients. They did not have very large Datastore sizes and some Tech had created a SnapShot three months ago and forgot all about it. Sure enough the delta file had grown to a size that consumed all the free space on the Datastore.
It never seemed to sink in, no matter how many times I sent out the reminder email for proper SnapShot edict. Someone would forget and I would find forgotten machine SnapShots. So this script was born to police them so to speak. It rolls through all the vCenter names you place in the “$vcenters” variable and hunts down existing SnapShots. It generates a warning email and a CSV report based on the “$limit” variable.
In the script you will also see in the “IF” statement that triggers an alert it also checks to see if the Datastore has “SRM” in its name. My client at the time was placing “SRM” in the name’s of all their replicated Datastores. SnapShots for us on replicated Datastores where not permitted without
getting an email exception and could not be retained for more then one day. This is why there would always be an alert if SnapShots were found on a “SRM” protected Datastores.
GitHub Link: Find-SnapShots-Report.ps1