user1168784
user1168784

Reputation: 233

Scheduling a task in Windows Server 2008 R2

I have scheduled a task to run a SSIS job using the Task Scheduler (TS). It is configured to run as a User who belongs to the Admin group.

The security is "Run whether user is logged on or not" is checked "Dont store password" is checked "Run with highest preveilage" is unchecked

The scheduled task run ONLY when the user is logged in but when the user logs out the task doest seem to run. I figured "Run whether user is logged on or not" should run the task when the user isnt logged on.

What am I missing?

Upvotes: 23

Views: 61589

Answers (4)

Ganesh D
Ganesh D

Reputation: 521

Follow like this:

  1. Type in secpol.msc /s
  2. Select "Local Policies" in MSC snap in
  3. Select "User Rights Assignment"
  4. Right click on "Log on as batch job" and select Properties
  5. Click "Add User or Group", and include the relevant user.

Upvotes: 52

Marshal
Marshal

Reputation: 4880

You might find in sig606's solution that the "Add User or Group" is greyed out in Administrative Tools->Local Security Policy->Local Policies->User Right Assignment->Log on as a batch job, Local Security Setting tab. If that's the case, you need to check your Group Policy in AD. A good reference is here.

Basically on your DC, Administrative Tools->Group Policy Management->Computer Configuration->Policies->Windows Setting->Security Settings->Local Policies->User Rights Assignment->Log on as a batch job, edit and add your user there.

Upvotes: 6

sig606
sig606

Reputation: 1866

When I setup tasks to "run whether user is logged on or not", I take this approach:

I create a user on that computer that is a member of no groups. This user is the designated task scheduler user. Open the Local Security Policy and grant that new user "Log on as batch job" permission. If you do not, you'll get this error: "This task requires that the user account specified has Log on as batch job rights." Specific instructions on how to set that permission are here: http://power-programming.co.uk/post/2010/11/18/Task-Scheduler-This-task-requires-that-the-user-account-specified-has-Log-on-as-batch-job-rights.aspx

Create the task in the Task Scheduler. Select the "Run whether user is logged on or not" radio button. Check the "Do not store password" checkbox. Check the "Run with highest privileges" checkbox. Assign the task to run under the new user account.

Upvotes: 22

ScottLenart
ScottLenart

Reputation: 1210

Try storing the password. If the user isn't logged in and the password isn't stored there may be no proper authentication. If its a domain user, you can also try creating a local user whose password never expires.

Upvotes: 2

Related Questions