Welcome To NetTech Solutions

Warm Welcome to Every Visitor. Here we serve best technical support, all the posts here you find will help you solving and facing the day to day problems.
Every one is welcome to comment on our Posts.

Thursday, March 6, 2014

Scheduling robocopy jobs with Windows Task scheduler

Scheduling robocopy jobs with Windows Task scheduler gives error unable to connect bad user name and password.

Scheduling Robocopy Jobs
You can create Robocopy jobs that run regularly and automatically in the background to maintain local mirrors of remote directory trees. In Windows 2000, use the AT command, or use the SOON command with the Windows 2000 Schedule service. (The SOON command runs Soon.exe, a Windows® 2000 Resource Kit tool named Near-Future Command Scheduler.)
By default, the Schedule service logs on as the system account for the local system, which has no network access. Scheduled jobs run in the same context as the Schedule service. To run a scheduled Robocopy job, however, Robocopy must connect to network drives, which requires some additional configuration. The following sections describe two ways to accomplish this.
Using the Local System Account
You can leave the Schedule service running in the context of the local system account. You can then schedule batch files by using the following commands:

 NET USE \\remoteserver\IPC$ /USER:userid password
 ROBOCOPY \\remoteserver\sourcepath \\localserver\destpath ...
 NET USE \\remoteserver\IPC$ /DEL

Within each job, credentials with remote servers are validated by connecting to the IPC$ (Interprocess Communication) share on remote computers using an appropriate user account, rather than the local system account. The disadvantage of this approach is that user passwords are stored in the batch files; however, passwords can be protected by storing the batch files on an NTFS volume, and setting appropriate NTFS permissions on the batch files.
Using a User Account
You can configure the Schedule service to log on as a user account. Once the user account has been granted appropriate access to source and destination servers, you can schedule Robocopy jobs to copy files between them.
To configure the Schedule service to log on as a user account
 1. In Services in Control Panel, click Schedule, and then click Startup.
 2. In the Startup Type box, click Automatic or Manual.
 3. In the Log On As box, select the account in which to run the service, and specify the correct logon password.


Tip
Because drive mappings can be changed by users, it is more reliable to use UNC names for source and destination directories in scheduled Robocopy jobs. For example:
ROBOCOPY "\\server1\share1\source"  "\\server2\share2\dest".

No comments: