permissions - Run task scheduler task on demand from limited user account in windows 7

07
2013-09
  • avok00

    My goal is to for a limited used to be able to run a netsh script that requires administrative privileges:

    netsh wlan stop hostednetwork
    netsh wlan start hostednetwork
    

    From my administrative account I created a task scheduler task that runs this script with elevated privileges and saved my admin password in it. It worked. But the task is not visible from the limited user account.

    I tried creating the same task from the limited user task scheduler - did not happen, it told me the user has no rights to create the task.

    Tried schtasks.exe from the limited user, it also does not show the task I want to run.

    Is there a way to share the task I created from the administrative account with a limited user so he is able to run it on demand? Or give him privileges to create the task himself?

  • Answers
  • avok00

    Solved it.

    Just go to C:\Windows\System32\Tasks find the related task and assign "read and execute" rights to the user you want to be able to access it. Be careful to assign to "current object only". Then the task will be visible and runnable from the limited user and if you saved your credentials within it and checked "run whether user is logged on or not" - it will work.

    Thanks everyone!


  • Related Question

    login - How do I keep a scheduled task running even though no user is logged in (Windows XP)?
  • Kit

    I wrote a temperature logger program and entered it as a scheduled task in Windows XP.

    So far, I was able to achieve this objective:
    1. Get the task to run even before anyone logs in (i.e. at the "Press Ctrl-Alt-Del" screen)

    But I'm having problems with these:
    1. When I log in, log out, then log back in, the scheduled task is no longer active. I can no longer see it in the Task Manager's Processes tab. I suspect it closes when I log out.
    2. I tried to set the task's "Run As..." property to DOMAIN\my-username and also tried SYSTEM, but problem #1 above still persists.

    SUMMARY:
    I want my program to be running as long as Windows is active.

    EDIT 1:
    My program is actually a Python script. So its command line in Scheduled Tasks is:

    C:\Python26\pythonw.exe "C:\path\to\templogger.py"
    

    It writes data to a file in local public folder (e.g. fully accessible by all who login locally).


  • Related Answers
  • John T

    The best approach for this is to run it as a service. You can probably get away with it just by using Sc.exe.

  • Sarah

    Have you tried giving the user "log on as a batch job" and "log on as a service" rights ?