mnevoso
asked on
Scheduled Task run permissions
I am trying to create a script at logon which creates a task that schedules a restart each evening.
I am able to get the task to schedule as well as run the command i am executing in the task. I am unable to get the task itself to run due to users not having any local admin rights. here is the script:
SCHTASKS /Delete /TN * /F
SCHTASKS /Create /SC DAILY /ST 23:59:00 /TN "Nightly Restart" /TR "Shutdown.exe /r /f /t 30" /RU DOMAIN\username /RP "password"
Any insight on being able to schedule the task and allow the users to run it will be very helpful thanks.
I am able to get the task to schedule as well as run the command i am executing in the task. I am unable to get the task itself to run due to users not having any local admin rights. here is the script:
SCHTASKS /Delete /TN * /F
SCHTASKS /Create /SC DAILY /ST 23:59:00 /TN "Nightly Restart" /TR "Shutdown.exe /r /f /t 30" /RU DOMAIN\username /RP "password"
Any insight on being able to schedule the task and allow the users to run it will be very helpful thanks.
ASKER
i have tried this with the same result.
I just pasted the SCHTASKS command above on my machine and ran it and it rebooted.
What is the exact problem?
What is the exact problem?
ASKER
the users in the domain do not have local admin rights or even power users rights to run the schedule task. that is the issue
Sorry I missed the part about it running from a logon script. Yeah, you can't do that without admin rights. However, if you are just trying to install a scheduled task that reboots the system every night you can do it remote using schtasks
SCHTASKS /Create /SC DAILY /ST 23:59:00 /TN "Nightly Restart" /TR "Shutdown.exe /r /f /t 30" /RU SYSTEM /S RemoteMachineName.
The /S flag will create the task on the system specified. This could be scripted.
Alternately if you have a domain, you can opt to use a startup script in a group policy assigned to the OU that contains the computers. The startup script runs under the system context and would be allowed to create the scheduled task. You would only need to enable the GPO until all of your computers got the task installed, then you can remove the GPO.
SCHTASKS /Create /SC DAILY /ST 23:59:00 /TN "Nightly Restart" /TR "Shutdown.exe /r /f /t 30" /RU SYSTEM /S RemoteMachineName.
The /S flag will create the task on the system specified. This could be scripted.
Alternately if you have a domain, you can opt to use a startup script in a group policy assigned to the OU that contains the computers. The startup script runs under the system context and would be allowed to create the scheduled task. You would only need to enable the GPO until all of your computers got the task installed, then you can remove the GPO.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SCHTASKS /Create /SC DAILY /ST 23:59:00 /TN "Nightly Restart" /TR "Shutdown.exe /r /f /t 30" /RU SYSTEM