Using wbadmin in Task Scheduler

Hello eveyone.

I have a testing server. I installed Windows Server 2012 R2, ran Windows Update, and have configured the following on it: DHCP, DNS, and Active Directory. Now I'd like to setup a backup job using WBADMIN in Task Scheduler.

I followed the instructions in this article and here is my simple command:

SCHTASKS /Create /SC DAILY /TN Daily_Volume_D_Backup /RL HIGHEST /ST 22:00 /TR "WBADMIN START BACKUP -backupTarget:E: -include:D: -vsscopy -quiet >> E:\app_data_backupLogs.txt"

   

I'm asking the Task Scheduler to run a daily back up of all files in my D: drive on to my E: drive. When I type this part in to the command line it works fine. I can see WBADMIN generate the backup folder and the log file says eveything worked out.

WBADMIN START BACKUP -backupTarget:E: -include:D: -vsscopy -quiet >> E:\app_data_backupLogs.txt




But when this is run by the Task Scheduler it doesn't work. Nothing happens at all, the Task Scheduler just return an error of 0xFFFFFFF in the "Last Run Result" column. I am running this task with the highest previliege as the Administator.

I put my above WBADMIN command in a batch file and asked the Task Scheduler to run it. In this way, it will acutally say "Taks is running" but that message will go on for hours and hours without producing any real resut unitl I tell it to "End" this task. When I click on my batch file directly, WNADMIN runs as expected. I can see it produce the backup file in the correct location and the log file confirms that.

So what have I done wrong here?


  • Edited by andrewsun Wednesday, July 15, 2015 6:56 AM correcting typos
July 15th, 2015 6:51am

So I did lots of googling, reading, trying, and failing. This is supposed to be super simple, right?

Anyway. Looks like I found my solution. It is largely based on this and this articles.

#1) I put the WBADMIN commands into a batch file. The commands are sound because they work perfectly fine when I click on it direcly. I asked Task Scheduler to run the batch file.

#2) In Task Scheduler, I was running the backup scheduled task as the local Administrator. Instead, I changed the the user who is running the backup to the local Administrators user group.

I don't know why these changes make this work. But it does. If you have the same issue, do the same as I have and it may get yours working too.

  • Marked as answer by andrewsun 1 hour 18 minutes ago
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2015 1:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics