I've been noticing a few stray/orphaned snapshots left by our new backup solution and was looking for a way to quickly locate them using PowerCLI.
1. Launch PowerCLI 5.1 as administrator, then connect to your vCenter server with the following command:
Connect-VIServer –Server "myvcenterserver" -Protocol https –User
"myusername" –Password "mypassword"
Enter the appropriate info for "myvcenterserver", "myusername"and "mypassword".
2. After connecting to your vCenter server, run the following command to query vCenter and find all of your open snapshots:
Get-VM
| Get-Snapshot | Select Created, VM
The output will display the date and time the snapshot was created and the VM name.
To export to csv:
Get-VM | Get-Snapshot | Select Created, VM | export-csv C:\temp\snapshots.csv
Happy Hunting.
I'm a Sr. Systems Engineer at a Global Environmental Engineering company. I've been in IT since 1999 and from 2005, my focus has been VMware datacenter products. More recently, my attention has been for Microsoft Azure services. As the Global Service Owner for VMware Datacenter products, I've had the pleasure of having in-depth and hands-on experience with not only VMware products, but server, storage and networking technologies.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment