The ultimate backup script for Window Server

This backup script is based on various components (Windows Server Backup, Robocopy, 7Zip) to create backups from a Windows Server


  • Rotation: daily, weekly (on Monday) or monthly (every 1st day of the month).
  • Compression: using 7Zip (the binary are included in the package) – Optional
  • Synchronization to a remote location: based on Robocopy and the option “/MIR” – Optional
  • Logging: a log file is created for each task and for the current month
  • Email notification: an email with the summary of the backup task is sent – Optional
  • Backup Type: you can realize a “system state” or “baremetal” backup


How to configure it?

In first DOWNLOAD zip file Backup-Script, unzip the zipped file on a specific location and create a new folder to store your backups.

After that, modify the file “Backup-Config.xml” like this:

The sections “Destination” and “Notification” are required. They are just needed if you are using the synchronization and the notification functionalities.


How to launch a backup?

You just have to call the script with the correct parameters.

Example 1: Backup-Task.ps1 –ConfigFile e:\WSB-Script\Backup-Config.xml –Compress –Sync –Notify

Explanation: Run a “system state” backup with options compression, remote synchronization and mail notification


Example 2: Backup-Task.ps1 –ConfigFile e:\WSB-Script\Backup-Config.xml –BackupType BareMetal

Run a “baremetal” backup without compression, remote synchronization and mail notification.



Be the first to comment

Leave a Reply

Your email address will not be published.