Sunday, 12 July 2009

Running a Scheduled Task Using the System Account

I quick guide on what the title says really. It came about through a need of moving data you might not necessarily have permission to access and that the 'system' does. I am also publishing the guide because I saw several other webpages saying it wasn't possible.

In this example I'm performing a data move using the RoboCopy program. RoboCopy (Robust Copy) is used because it has comprehensive logging, the ability to restart a failed attempt & keeps all NTFS permissions intact.

Although I have an admin account, which should have access to all the files, it is possible for somebody to strip this access out blocking me access to the files unless I take ownership - this would also cause the RoboCopy job to fail.

Right, that's the reason behind this then - lets get started. Open up the Scheduled Task's page from the Control Panel and then start the New Scheduled Task wizard. Go through the initial options as you require. In my scenario I selected the batch file I created for the robocopy job and it's options, I also selected the run once option and the time/date the move was due to take place.

When it comes to the user name/password option just type in system and leave the password fields blank. Open up the advanced properties dialog box and you should see the run as box listing 'NT AUTHORITY\SYSTEM' populated.

Easy.

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete