VMware Cloud Community
nileshzend
Contributor
Contributor

To create PowerCLI 6.0 script for create & delete snapshot of multiple vm (some for daily basis & some weekly)

plz help me ?

To create PowerCLI 6.0 script for create & delete snapshot of multiple vm (some for daily basis & some weekly)

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

You will have to give a bit more information.
How do you select which VMs, and how you select the daily and weekly snapshots on those VMs?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
nileshzend
Contributor
Contributor

i have installed windows server 2012 vcenter (here i installed powercli 6.0),


i want to select this vm from script & this scripts need to run from windows task scheduler ( from task scheduler i am able to run this script for daily or weekly basis.)


if you have any single script which able create or delete of multiple vm 


Reply
0 Kudos
LucD
Leadership
Leadership

Removing snapshots from VMs is really quite straightforward.

The following will remove all snapshost from all VMs.

Get-VM | Get-Snapshot | Remove-Snapshot -Confirm:$false

If that is not what you want, you will have to give more information on how to select the snapshot(s) to remove.

For using the Windows Task Scheduler, have a look at Alan's Running a PowerCLI Scheduled task post.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
iamamit
Enthusiast
Enthusiast

Please refer my reply on below thread, it should help you in what you are looking for. May be you want to schedule it in some task scheduler.

https://communities.vmware.com/message/2655163#2655163

Thanks,

Amit

Reply
0 Kudos