By Ivy / Last update October 22, 2021

Overview of Wbadmin commands

Wbadmin is a built in command-line tool for Windows Vista/7/8/10 and Windows Server 2008/2008 R2/2012/2016/2019/2022. It replaces previous command line utility, NTBackup and allows you to backup or recover operating system (OS), drive volumes, computer files and folders, apps from an elevated command prompt.

The backup files are saved as Microsoft’s Virtual Hard Disk (.VHD) files with some accompanying .xml configuration files. And this file can be mounted in Windows Disk Manager.

Specificly, with the help of Wbadmin, you can enable, create, restore, disable, stop, delete backup, and get information of backup and its content. For the detailed WBadmin syntax and explanation, you can refer to the Microsoft TechNet website.

Then, scroll down to the following parts and learn all instructions related to Wbadmin backup Windows Server 2012 and restore.

How to use Windows Server 2012 Wbadmin

Here you will learn how to use Wbadmin syntax to backup, restore and delete backups in the Windows Server 2012. Also, this command works for later operating systems, such as, 2012 R2, 2016, 2019, 2022. Please the use of Wbadmin requires Windows Server Backup installed on your server computer.

To install Windows Server Backup: 

1. Open Server Manager, and select Manage > Add Roles and Features.

2. Choose the default settings until go to the Select Features window, scroll down and select Windows Server Backup, and click Next.

Install Windows Server Backup

3. Press Install, and it will start to install this feature automatically. After this process completes, just close this window.

Backup Windows Server 2012 using Wbadmin 

Here you will see four examples to backup Windows Server 2012 with Wbadmin, including bare metal backup, backup to network share, hyper-v backup and Wbadmin scheduled backup server 2012. Let's get it on.

Example 1: To do a bare metal backup to E: drive with the following command:

wbadmin start backup -backuptarget:e: –include:c: -allcritical -systemstate -vssfull

Wbadmin Bare Metal Backup

 

Note: The -allcritical switch will include all items for a bare metal recovery. Whether you add -systemstate switch or not, it makes no differences to what will be included in the backup, leaving you the option to run a system state recovery without restoring the whole server.

Example 2: To create a backup that includes C: drive and Video folder on D: drive to the network drive:

wbadmin start backup -include:c:,d:\video -backuptarget:\\192.168.1.222\backup -user:1 -password:1 -quiet

Note:
1. When you specify more than one item with -include: switch, use commas to separate them without space.
2. The -user and -password switch is needed when specifying a network location as the backup target.
3. The -quiet switch means this backup will run without prompting you.
4. You can also specify more than one times of a day to run the backup.

Example 3: To start a Windows Server 2012 hyper-v backup for virtual machine, and save it to C drive:

wbadmin start backup –backuptarget:c:  –hyperv: “Server 1”

Example 4: To create a daily scheduled system state backup to G: drive:

wbadmin enable backup -addtarget:g: -systemstate -schedule:06:44

Note: The -schedule switch is to specify the time to run the WBadmin scheduled backup.

Restore Windows Server 2012 by Wbadmin 

Like the backup operations, here are 4 examples to restore backup with Windows Server 2012 Wbadmin. To perform bare metal recovery, you need to boot into Windows Recovery Environment and open command prompt.

Example 1: To restore a backup created on June 17, 2020 at 04:41, and saved on E drive, type as follow.

wbadmin start sysrecovery –version: 06/17/2020-04:41 –backuptarget:e: -machine: Server 1

Wbadmin Bare Metal Recovery

 

Notes:
1. To restore a backup, you need to get backup version identifier, backup location, type the following commands. Please note the drive letter may change under Windows RE, so GUID-based path will be better choice.
   • To find out the backup version identifier: wbadmin get versions –backup target:
   • To get the volume GUID-based path, mountvol
2. To list items of a backup, wbadmin get items –version: -backuptarget:
3. -machine: the paramether is only used when you backup multiple computer to the same backup target. 

Example 2: To restore a backup on network location, run the following command.

wbadmin start recovery –version: 06/17/2020-05:33 –backuptarget: \\192.168.1.222\backup -machine: Server 1

Example 3: To restore hyper-v backup created on June 17, 2020 at 06:28, and the backup location is E: drive, type as the following command.

wbadmin start recovery –version:06/17/2020-06:28 –itemtype:hyperv –items:”Server 1” -backuptarget:e:

Example 4: To restore a system state backup created on June 17, 2020, at 06:44, and saved on E drive, type the following commands.

wbadmin start systemstaterecovery -version:06/17/2020-06:44 –backuptarget:e:

Note: If you want to specify the backup location, you could add –backuptarget paramether.

Delete Windows Server 2012 backup with Wbadmin

Your backup disk will be full sooner or later as the increasing number of backups, so deleting old backup on Windows Server 2012 is imminent. Here are three parameters you need to know, which can help you delete backup files, whether it's system state backup or non-system state backup.

  • [-version]: to delete specific version(s)

  • [-keepVersions]: to delete all backups but the specified versions

  • [-deleteOldest]: to delete the oldest backup

Example 1: To delete non-system state backup taken on June 17, 2020 at 06:22, and saved to E drive, copy and paste the command below.

wbadmin delete backup -Version: 06/17/2020-06:22,-backupTarget:e:

Wbadmin Delete Backup

 

Example 2: To delete all system state backup on E drive except the latest three versions, run the command below.

wbadmin delete systemstatebackup -keepVersions:3 -backupTarget:e:

Note: In Windows Server 2008 R2 or other previous versions of Windows Server, WSB does not allow you to directly delete non-system state backups. As a workaround, you can delete the corresponding shadow copy on the backup target location. To delete shadow copy, you could use the command line "diskshadow".

That's all for how to use Windows Server 2012 Wbadmin. If you are familiar with Wbadmin syntax and necessary parameters, you can easily backup, restore and delete image. If not, you may feel it's a big headache. You need to learn all the necessary syntax and parameters, and any small error may result in operation failure. 

And it still has some limitations, for example, it only works for partition formatted with NTFS file system, you can only create one schedule backup, etc. Thus, you may want an easier way to backup and restore Windows Server 2012. You could use a professional server backup software.

Easier way to perform Windows Server 2012 backup and restore

Except for Wbadmin, you can still use a third-party server backup software with graphic user interface. AOMEI Backupper Server is a great option, widely used in all the Windows opeating system, including 2003/2008(R2)/2012(R2)/2016(R2)/2019 and Windows 7/8/8.1/10/11/XP/Vista.

It supports all kinds of backup solution, including system backup, disk backup, partition backup, file backup. Also, you can set schedule backup and backup scheme to automatically backup what you want and  delete backups without performing any separate operation. To be specific: 

You can set the backup frequency you want, such as, daily/weekly/monthly schedule backup.
You can also backup at a specific event with event triggers or use dedicated storage device for backup, backup computer to USB flash drive automatically with USB plug in feature, for example.
You can choose to backup only changed files with incremental and differential backup instead of backup everything.
You can also set how to delete old backups, such as, by quality, by time or by daily/weekly/monthly.

Beside these features, it still works well in any detected storage by Windows, for example, internal/external hard disks, solid state drives (SSD), USB flash drives/pen drives, hardware RAID array, dynamic disk, and network share. And it supports partitions or disks formatted with all file system, not just NTFS, such as, FAT 32, FAT16, EXT2, and EXT3.

Now, let’s have a closer look at how to perform Windows Server 2012 backup and restore with Wbadmin alternative - AOMEI Backupper Server. Here are the steps. 

Backup Windows Server 2012 with AOMEI Backupper Server

To create a disk backup, for example, you need to download and open this software, click “Backup” and “Disk Backup”. 

Download Free Trial Window server 2012/2016/2019 /2022
Secure Download

Backup Windows Server 2012

Note: If you want to create system backup, partition backup or file backup, click the corresponding backup type and follow its on-screen intructions.

 Then, you will see the Disk Backup page, click "Add Disk" to select the disk you want to backup. To add multiple disk, click the "+" icon to select disk one by one.

Add Disk

After that, click the inverted triangle icon to select a destination to receive your backup. You have two choices, namely, Select a local path and Select a network location. Here take Select a local path as an example to backup Windows Server 2012 to an external hard drive.

Select Backup Destination

Now, you can directly click “Start Backup” to start the backup task. But if you want to make the backup task more flexible, you need to add some backup settings in the "Options", "Schedule", "Scheme".

Backup Windows Server 2012

Useful settings to schedule your backup:

"Options": You can enable emmail nofication, encryption, compression, comment, pre/post-command etc.

Schedule”: You can set up automatic backup, including backup frequencycy, backup event triggers, dedicated storage device for backup, backup methods. 

  • Backup frequency: You can backup Windows Server 2012 in daily/weekly/monthly, so you can include all the items after the previous backup. as not to miss any changes, such as, modified files and newly installed programs.

  • Backup event triggers: You can use its "Event triggers" to backup server 2012 in System Startup, System Shutdown, User Logon, User Logoff.

  • Dedicated storage device for backup: You can use its "USB plug in" feature to automatically backup server 2012 to USB drive automatically when it's plugged in. Also, you can backup files to Windows Server 2012 with this feature.

  • Backup Method: You can choose to backup all the data every time with "Full Backup" or only backup changed files with Incremental or Differential Backup to largely save backup time and disk space for users.

Schedule Settings General

 “Scheme” : You can use it to delete old backups automatically by quality, time and by daily/weekly/monthly. 

Restore Windows Server 2012 with AOMEI Backupper Server

To restore backup created by AOMEI Backupper Server, go to the “Restore”  tab and then choose “Select Task” or “Select Image File”, depending on if your backup can be recognized directly.

Restore Windows Server 2012 Backup

Notes: 
• If your computer is unbootable, you need to create a Windows Server 2012 recovery disk on a working computer first and then restore the failing computer. 

If you choose "Select task", you will be asked to select the backup image you want to restore. Then, click "Next" to continue.

Select Task

Then, you need to select the items you want to restore. Select "Restore the entire disk" if you want to restore everything from this backup and click "Next".

Restore Entire Disk

After that, in the Disk Restore window, select the restore destination to receive the backup image. Then, click Next. 

Select Destination Disk

Now, you need to confirm the restore info and click “Start Restore” to restore Windows Server 2012.

Restore Windows Server 2012

Other options you may need:

"SSD Alignment": If the restore destination is an SSD disk, you can tick this feature to accelerate its reading and writing speed. 

"Edit Partitions": If the destination disk is larger, you need to adjust the partition size of it. Otherwise, the destination disk will not show full capacity

"Universal Restore": If you want to backup and restore disk image to new computer with dissimilar hardware, you can tick this feature to resolve the driver incompatible. 

Wrapping things up

That's all for how to use Windows Server 2012 Wbadmin commands. Please note that backup partitions or volumes requires to be NTFS file system. And this command line has many syntax which is a little tricky for lots of users to master. Therefore, it's suggested to use a backup software with GUI interface, AOMEI Backupper Server, for example, so users can understand and use it easily and quickly.

With it, you can backup disk, system, partition and files effortlessly. Also, it allows you to schedule the backup task by clicking "Options", "Schedule" and "Scheme". For advanced users, AOMEI Backupper also provides you a command line utility AMBackup.exe to backup Server 2012 and restore it when needed. Compared with Wbadmin, it’s very easy to understand.

In addition, it still allows you to restore your computer, even with dissimilar hardware, thanks to the universal restore feature. To deploy or restore image to multiple computers, you could use AOMEI Backupper TechPlus