Monday, December 14, 2009

Robocopy and Server 2008 Script Error

If you are going to use Robocopy with Windows Server 2008 as a script you are going to run into a few errors. The first is that you have to allow the account you are using to execute the script to be allowed to log on as a batch job.

Local Security Policy > Local Policies > User Rights Assignment > Log On As A Batch Job > Add User or Group

Next add the user account to the Backup Administrator's group in Computer Management > Local Users and Groups

You will also need to tweak the job in Task Scheduler to have the following things: Select "Run whether user is logged on or not" and check "Run with Highest Privileges". If you do not select the "Run with Highest Privileges" check box then you will get the following error:
-------------------
ERROR : You do not have the Backup and Restore Files user rights.
***** You need these to perform Backup copies (/B or /ZB).

ERROR : Robocopy ran out of memory, exiting.
ERROR : Invalid Parameter #%d : "%s"

ERROR : Invalid Job File, Line #%d :"%s"
--------------------
That box is the equivalent of right click, "Run As Administrator" on the command prompt window.