Page 1 of 1

Task Scheduler

Posted: Thu Nov 12, 2015 7:21 am
by devereux0110
We have a script which basically reads through a csv files of student usernames and resets the password in AD to default password, the script functions with no problem if I run it manually on the DC and writes to a txt that password is reset for which user and then the CSV file is deleted.
The script then runs in a loop pausing for 30 seconds and then checking for another CSV File then pausing for 30 seconds and so on until 10pm at night before the script Quits.

The CSV file comes from another script which teachers run to automate reset students passwords.

We are Server 2012 R2
We added a Scheduled Task to run this automatically each morning at 7am to complete the automation of reset students passwords which have done previously on Server 2003 years back.
The task runs a 7am and writes to the txt file as though it as reset the password but it doesn't actually reset the password like it does if we run the script manually.

If the server is logged on with an account when the scheduled task starts it works, if it is not logged on with anyone, the scheduled task starts writes to the log files but doesn't reset the passwords, the task schedule is set to run weather a user is logged on or not and run in highest privileges but unless the user is logged on at the start time of the task, it doesn't reset the passwords.

Once the task is successfully running the server can be logged off and it continues to work, does anyone have any idea why this may happen

Re: Task Scheduler

Posted: Thu Nov 12, 2015 8:12 am
by jvierra
This does not appear to be a script issue. It is likely that you need to redefine your task and be sure it is working as needed.
If you have issues with the task scheduler post in the Microsoft forum for WS2012R2 for assistance.

Re: Task Scheduler

Posted: Thu Nov 12, 2015 2:48 pm
by devereux0110
Posted here because I thought may be others that have run scripts this way may have had the same issue.

The script does work when run manually when logged on, just not when server is logged off and run by task scheduler, thought maybe something needed adding to the script to make it work correctly with server in logged off state

Re: Task Scheduler

Posted: Thu Nov 12, 2015 4:13 pm
by jvierra
The issue is with the scheduler which is very different in WS2012. Ask the script author to help you set it up correctly for your script.