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.
mnevosoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PberSolutions ArchitectCommented:
Run the scheduled task under the system account.
 
SCHTASKS /Create /SC DAILY /ST 23:59:00 /TN "Nightly Restart" /TR "Shutdown.exe /r /f /t 30" /RU SYSTEM
0
mnevosoAuthor Commented:
i have tried this with the same result.
0
PberSolutions ArchitectCommented:
I just pasted the SCHTASKS command above on my machine and ran it and it rebooted.
What is the exact problem?
0
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

mnevosoAuthor Commented:
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
0
PberSolutions ArchitectCommented:
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.
 
 
0
mnevosoAuthor Commented:
I resolved this issue by using Preferences in GPO.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.