here is a script i put together to loop through the RVTools result and mount all the suspect VMDKs
Tag: PowerCLi
VCSA Cert checking script
Over the past year I have seen quite a few STS certs expire in production environments. I have been meaning to write something to scan a VCSA and report back the expiry dates of all the certs. This has posed a problem because I have to use SSH and one command needs to follow another….
VM clone script
This is a VM clone/”backup” script that I use in my home lab. I schedule this script to make a clone of important VMs (works with vCenter) and clones them to another datastore. Obveusly this is not a proper backup but if I make a config change or lose a datastore then this will (and…
Snapshot Deletion script
This is a script I wrote to delete snapshots over a certian age wth an override. The override is in the name of the snapshot, so the snapshot can be deleted after x days or after a date. If the snapshot is named “my snapshot _ DeleteAfter60days” the script will look for “DeleteAfter” or “DA”…
Report VM reconfigurations
One this that has always bugged me with vCenter UIs is seeing a reconfigure VM task but not being able to tell what was changed. Some times in an investigation this can be very important. While looking at Event objects one day I discovered an attribute called configchanges on a reconfigured event object. In there…
Get tasks with events
Here is a script to get tasks (historic tasks not just current) and also the events associated with that task.This is very handy for auditing or troubleshooting. The task collection part of the script I found on LucD blog at https://www.lucd.info/tag/get-task/ Basically this will get all tasks and events for a specific time frame. It…
Powershell Tutorial Dealing with Snapshots
Snapshots, if left undetected will grow and consume space as well as slow your VMs down if you have enough of them. This is an endless battle for the system administrator as (in my experience) developers will want to keep snapshots forever. This often leads to the same “snapshots are not backups” conversation. In this…
Find VMs restarted by HA
Administer VMWare long enough and you will eventually lose a host. If you are using HA you may not notice until the phones start ringing some time later. At this point all the VMs are back on line on different hosts. When Problem management/bosses get involved you will normally be asked “what VMs restarted?”here is…
Find and remove connected CD drives using PowerCLi
If you work in an environment where no one remembers to disconnect their ISO images when done then this script is for you. This script will report each VM with a connected CD drive and its ISO path, to a CSV fileAlso once a specified number of days have passed (assuming this script is run…
Getting and Setting the Scratch location
The scratch partition on an ESXi host stores log information and will be set to the RAM drive by default. This means that any information written there will not survive a reboot, or could interfere with the stability of the host in low memory situations. Getting and setting the scratch location is quite easy with…