Create Backups with Windows Server Backup Command Line

Posted by @Cody

June 7, 2016

In Windows Server 2016/2012/2008, you can use Windows Server backup command line tool to create scheduled or one-time backup job.

Microsoft has brought us the Windows Server Backup since Windows Server 2008, as a replacment of NTBackup. Windows Server Backup is at the block level, which is more advanced than the file and folder level of NTBackup. As a great improvement, it allows you to perform backups or restores in a faster, simpler, and more reliable way. You can configure a backup or recovery job via the graphic users interface (GUI) or the command line. This article will show you how to use the Windows Server Backup command line tool WBadmin.exe in a few ways. However, this backup utility is not pre-installed by default on Windows server 2008 or 2012. To be able to use it, you need to add both the Windows Server Backup and Command-line Tools in Server Manager. With the WBadmin.exe utility, you can do even more things from command line than that you do form the GUI.

WBadmin examples

To use Wbadmin.exe, you need to open an elevated command prompt with administrator permission, and then run a backup command based on your needs. To access an elevated command prompt, you can enter “CMD” in a Run box or right click Start and select Command Prompt (Admin). With the command prompt, you can write a command to run a backup or recovery job referring to following WBadmin examples:

1. To create a system state backup to E: drive:

Wbadmin start systemstatebackup -backuptarget:E:

Backup to E

2. To create wbadmin backup to network share including all critcal volumes, system state, and “chrun” folder in D:drive to network shared folder:

Wbadmin start backup -allcritical -systemstate -include:D:\chrun -backuptarget:\\networkshare\backup -quiet

3. To create a scheduled backup job at 00:00 daily to the shared folder that can only be accessed with username and password:

wbadmin enable backup -addtarget:\\\Public\schedule -include:D: -systemstate -user:admin -password:1234 -schedule:00:00

4. To restore a full server backup to dissimilar hardware with version:11/11/2015-00:00 to another server with machine name Varlar:

Wbadmin start sysrecovery –version: 11/11/2015-00:00 –backuptarget:E: -machine:Varlar

5. To restore system state with version: 01/11/2016-01:09:

wbadmin start systemstaterecovery -version:01/11/2016-01:09 -backupTarget: F: -quiet

The switch: -quiet means to run the task without being prompted to enter “Y” to confirm. Although the Wbadmin command line tool is convenient for those who know how to use it, it does have some restrictions, Such as, Only partitions formatted with NTFS can be used as backup source or backup target, you cannot configure a scheduled backup less frequent than daily. Therefore, if you need more advanced command line backup solution, you can use third party backup software.

Alternative to run backups from command line

As an alternative to Windows Server WBadmin, AOMEI Backupper Server allows you to perform backup and recovery with more options and in a more flexible way. You can choose any files, folders, partitions, disks, or system as backup source and any location that File Explorer detects can be set as the destination location of the backup. Unlike Windows Server Backup, AOMEI Backupper allows you to schedule daily/weekly/monthly backup task followed by full/incremntal/differential backups.

To use command line backup feature:

1. Download and install AOMEI Backupper Server.

2. In an elevated command prompt, enter the path of the installation directory of this software and press Enter. For example, “cd C:\Program Files (x86)\AOMEI Backupper”.

Allocate Backupper

3. Type in the right backup ommand of AOMEI Backupper and press Enter. For example, to perform a system backup of your server to a folder named “system backup” in F: drive, run the command below:

AMBackup.exe /b new /t system /d “f: \system backup” /n “Backup System”

System Backup

Apart from backup and restore, AOMEI Backupper also allows you to use clone feature form command line. It supports almost all the Windows Server system including Windows Server 2002/2008/2012/2016. If you are not content with the Windows Server Backup command line tool WBadmin, you can try AOMEI Backupper Server, which now provides a 30-day trial.