Script to list the VMs with snapshots

Step 1:
                Connect to the vCenter Server using PowerCLI

Step 2:
Check whether the vCenter server has snapshots attached with VMs

Get-VM | Get-Snapshot | Select Created, VM

In the above case, it does not have any snapshots

Step 3:
Create a script file to export the snapshots in csv format.
Open notepad à copy and paste the text below à save as snapshot.ps1

connect-viserver vCenterserver -user username -password password
get-vm | get-snapshot | select vm,name,created,sizegb,description | export-csv H:\vCenter.csv
disconnect-viserver -confirm:$false

Step 4:
Now run a script file to export the snapshots in csv format 


No comments:

Post a Comment