Wbadmin Delete Backup for Windows Server 2016/2012/2008

Posted by @Cody

January 20, 2016

Learn how to use Wbadmin delete backup command to remove backups created by Windows Server Backup in Windows Server 2016/2012/2008 to save backup disk space.

Do you need to delete old backups?

According to Microsoft, Windows Server Backup (WBS) runs an automatic disk usage management to remove previous versions of backup to make room for the next backup. Seemingly, you don’t need to manually delete backups by running Wbadmin delete backup command because WBS is supposed to do it for you. Nevertheless, you will still have a backup failure for the backup disk is full after a running scheduled backups a couple of times. The truth is, WBS will stop automatically deleting old backups when WSB can no longer track the space allocated for snapshot. As you know, backups created by WSB cannot be deleted in File Explorer. To free up more space for new backups, you can use WBadmin command to delete old backups from the command prompt.

How to delete old backups?

There are basically two types of backups that WSB creates, system state backups and non-system state backups. You can use different command parameters to get rid of them. To use Wbadmin command, you need to open an elevated command prompt. You can right click on Start and select Command Prompt (Admin).

Delete system state backup

A system state backup is kept in an independent directory. Wbadmin provides 3 ways to specify the backups by using different parameters, [-version] to delete specific version(s), [-keepVersions] to delete all backups but the specified ones, or [-deleteOldest] to delete the oldest backup. For example: to delete the system backup that was taken on May the fourth evening at18:25, just run the following command in a command prompt:

Wbadmin delete systemstatebackup -version: 05/04/2015-18:25 -backupTarget: G:

Delete non-system state backup

If your server is running Windows Server 2012/2012R2 or Windows Server 2016, you can run delete backup command to remove backups as you wish. You can specify the backups you want to delete by using one, and only one, of the following parameters: -keepVersions, -version, or -deleteOldest. For example, to delete all backups except one backup version 11/10/2015-06:48, run the Wbadmin keepversions command below:

Wbadmin delete backup -keepVersion:11/10/2015-06:48 -BackupTarget:F:machine:WIN-9814GD4FH95

The parameter “-machine:” is only needed when you have backed up many computers to the same location.

In Windows Server 2008R2 or previous versions of Windows Server, WBS will 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:

1. Type: “DiskShadow.exe” in an elevated command prompt and press Enter.

2. Type the command: "delete shadows oldest G:” The parameter “G” has to be replaced with your backup drive letter or volume GUID. Delete Shadow

Generally, the backup drive has no drive letter. In that case, to use Wbadmin to delete full volume backup, you may need to manually assign a drive letter to the backup drive or run the command:”Mountvol” to learn the volume GUID. As a backup program, WSB works in some ways, but it still has a long way to be perfect. Instead of worrying about the scheduled backup will fail sometime, you can switch to another more dedicated backup software.

Remarkable backup software for Windows Server

AOMEI Backupper Server provides 4 types of backup solution to back up your server and 5 different ways to automatically delete old backups. In addition, you can set an email notification to tell your backup is taken or failed. Unlike WSB, AOMEI Backupper allows you to have as many scheduled backup tasks followed by full/incremental/differential backups as you like. Seeing its intuitive interface, you will like using it for your backup tasks.

To backup Windows Server with AOMEI Backupper:

1. Download, install and launch this server backup program.

2. Under “Backup” tab, choose one of backup types, System Backup, Disk Backup, Partition Backup, and File Backup. Here it is System Backup.

System Backup

3. Click Step 2 to specify a destination location path to save the image backups, for the program will include the partitions that a system restore requires in the backup automatically.

Destination Location

4. Click on “Schedule” to create a schedule for the backup task, and click on the Scheme to configure Disk Space Management for automatic backup deletion.

Backup Scheme

5. Click Start Backup to run the backup immediately or add the backup schedule.

Start Backup

Using AOMEI Backupper as your backup program, you don’t ever need to use Wbadmin delete backup to delete old backups, or even care to delete backups yourself because it will automatically do it in your desired way. If your server crushes, you can use the backup created by AOMEI Backupper to recover your server or restore to dissimilar hardware server with bootable rescue media or AOMEI PXE tool.