Task Scheduler

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 8 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
devereux0110
Posts: 38
Last visit: Mon Oct 02, 2017 7:11 am

Task Scheduler

Post 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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Task Scheduler

Post 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.
User avatar
devereux0110
Posts: 38
Last visit: Mon Oct 02, 2017 7:11 am

Re: Task Scheduler

Post 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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Task Scheduler

Post 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.
This topic is 8 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked