How to Perform Windows Server 2012 System Restore Using Command Line

Posted by @Ada

May 16, 2019

Command line is easy to use even you are not within windows. This article will introduce how to create Windows Server 2012 system restore using command line.

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 users 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).

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.

Check Image

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 Utilities tab.

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

Windows Shell Command

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 chooseAOMEI Backupper Technician Plus. It offers unlimited billable technical services to clients. It also enables you to copy installation directory for portable version creation.