wiki:powercli_script_to_get_all_snapshots
This script will query the Vcenter to get all active snapshots in a CSV file on your desktop
Make sure you have the PowerCLI modules installed first
Install-Module VMware.PowerCLI -Scope CurrentUser
Run then the following to export list of snapshots
set-Executionpolicy unrestricted connect-viserver -server YourVCenterAddress/Name get-vm | get-snapshot | Select-Object -Property vm,created,sizeGB,name,description | Export-Csv -Path C:\Users\$env:username\Desktop\snapshots.csv
If you want to filter the results and exclude some VMs (for example replicas of Horizon VDI)
get-vm | get-snapshot | Select-Object -Property vm,created,sizeGB,name,description | where-object {$_.VM -notlike "xxx*" -and $_.VM -notlike "zzz*"}
wiki/powercli_script_to_get_all_snapshots.txt · Last modified: by wagner.jer
