Powershell script for creating snapshots
The script creates a snapshot for each VM on the Hyper-V server.
Then
it removes all snapshots older than 6 days (except the ones made on a
Sunday).
CreateVmSnapshots.ps1 (1.01 kb)
Powershell script for exporting(backup) Virtual Machines
The script exports all the VM's to a given backup location.
It
pauses each VM if it's running, exporting and turn the VM back on if it
was running before.
CreateVmBackups.ps1 (1.75 kb)
Task Scheduling
Combine these two scripts with the Task Scheduler and you have a fully automated backup system!
To run a Powershell script in Task Scheduler enter Powershell as program and "& 'C:\Hyper-V\CreateVmSnapshots.ps1'" as argument.
PS:
Run the scripts once to see that they work before adding them to the
Task Scheduler, as no errors will be shown if they fail in the Task
Scheduler.