By AOMEI / Last Updated June 23, 2020

In Windows Server, system restore is a great utility to roll back system to the previous state if any emergency happens to system. You can run system restore from inside Windows with Recovery Wizard, or you can run Windows Server 2012 system restore with command line.

Why use command line to do system restore?

Command Prompt is available on every Windows NT-based operating system which includes Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows 2000, as well as Windows Server 2012/2008/2003.

Sometimes, however, a problem is so bad that your computer won't start normally, meaning you can't run System Restore from inside Windows. Fortunately, even if all you can do is start in Safe Mode and access Command Prompt, you can start the System Restore by executing a simple command.

Also, using command line is more convenient for batch files and batch commands.

Wbadmin values for system restore in Windows Server 2012

version:[versionidentifier]: Specifies the version for the backup to recover in MM/DD/YYYY-HH:MM format, as listed by wbadmin get versions.

authsysvol: Performs an authoritative restore of Sysvol.

backupTarget:{[volumename] | [networksharepath]}: Specifies the storage location that contains the backup or backups that you want to recover. Useful when the location is different from the location where backups of this computer are usually stored. NetworkSharePath should be in Universal Naming Convention (UNC) format.

showsummary: Reports the summary of the last run of this command. This parameter cannot be accompanied by any other parameters.

recoveryTarget:[targetpathforrecovery]: Specifies the directory to restore to. This is useful if the files that comprise the system state are restored to an alternate location.

machine:[backupmachinename]: Specifies the name of the computer for which you want to recover a backup. Useful when multiple computers have been backed up to the same location. Should be used when -backupTarget is specified.

quiet: Runs the command with no prompts to the user.

How to restore Windows Server 2012 with Wbadmin

As above mentioned, when you cannot start your computer normally, you can run Windows Server 2012 system restore with command line from recovery options.

Boot the Windows Server into WinRE with the installation disc if needed. At Windows Setup interface, click Repair your computer. Select Troubleshoot. Then choose Command Prompt in the advanced options.

At the prompt, type: wbadmin start systemstaterecovery –version:01/09/2013-18:28 –backuptarget:E:. This means run system state recovery from system state backup at E drive created at 18:28pm in 01/09/2013.

Command Prompt

For example, to run a system state recovery of the backup from 04/30/2005 at 9:00 A.M. that is stored on the remote shared folder \\servername\share for server01, type:

wbadmin start systemstaterecovery -version:04/30/2005-09:00 -backupTarget:\\servername\share -machine:server01

✎ Additional consideration:

To recover the system state using Windows Server Backup, you must be a member of the Backup Operators or Administrators group, or you must have been delegated the appropriate authority.

Another way to do Windows Server 2012 system restore with command line

AOMEI Backupper Server is a professional backup and restore software. It can be used to backup and restore the system from graphic user interface or command line. It supports both Windows system (Windows 7/8/8.1/10/XP/Visa) and Windows Server system (Windows Server 2003/2008/2008r2/2012/2012R2/2016). You can benefit a lot from its following features:

Various backup types
It offers different backup types for different needs. You can choose from system backup, disk backup, partition backup, and file backup according to your situation.
Multiple backup schedules
It enables you to set automatic backups. There are six schedule modes available: “Daily”, “Weekly”, “Monthly”, “Event triggers”, “USB plug in”, and “Real-time Sync”.
Advanced backup schemes
It can help you delete obsolete backups automatically so that you won't worry that the backup destination drive is filled up. Five schemes are offered: "Full Backup Scheme", "Incremental Backup Scheme", "Differential Backup Scheme", "Space Management Scheme", and "Other Backup Scheme".

Before you run Windows Server 2012 system restore with command line by AOMEI Backupper, make sure you have already created a system backup, and you can check if system image backup is intact and without error by using Check Image utilities. Also, if you cannot boot your computer, create a bootable media.

Create Bootable Meida

After all this done, let’s take a look at how to run Windows Server 2012 (R2) system restore from command prompt.

Step 1. Boot the machine from the bootable media, and it will bring you to the interface of AOMEI Backupper. Then open Windows shell command under Tools menu.

Tip: if you can boot the computer, press Win + R and type cmd to open command prompt.

Step 2. Type in the following command in command prompt to navigate to AOMEI Backupper installation directory by typing in: cd [installation path of AOMEI Backupper] and press Enter. For example: cd C:\Program Files\AOMEI Backupper. Note that the drive letters might change under Windows PE environment.

Step 3. Run the following command to start restore: AMBackup /r /t [backup type] /s "[backup location path]" /d [destination location]

For example: To restore the system backup saved in D:\system backup to disk 2.

AMBackup /r /t system /s “D:\system backup\system backup.adi” /d 2

AOMEI Command Line

If you want to perform a universal restore, AOMEI command line still can do this for you.

For example: Restore system in the image named "system backup10.adi" to the partition 0 on disk 0 and perform a universal restore.

AMBackup /r /t system /s "D:\system backup\system backup10.adi" /d 0:0 /x

Besides system restore, this can be used to perform disk restore and partition restore. Also, it is very easy to create data backup using CMD and clone with command line.

All in all, there are two methods to create Windows Server 2012 (R2) system restore with command line, you can choose one based on your preference.

If you want to protect unlimited PCs and servers within your company, you may choose AOMEI Backupper Technician Plus. It offers unlimited billable technical services to clients. It also enables you to copy installation directory for portable version creation.