locked
Running Application As Admin for Standard User (using Task Scheduler) RRS feed

  • Question

  • We have several machines here where a standard login is used for test subjects to run the MATLAB application, however the application needs to be run as an administrator. I am not willing to include the admin credentials in the shortcut to launch, but I did find an alternative that seems promising - however there seems to be something missing.

    (For reference, this is my source:  http://superuser.com/questions/581548/runas-savecred-ask-for-password-if-another-user-runs-the-same-batch-file/903881#903881)

    Attempt #1:  I logged onto the computer as a standard test user. I launched Task Scheduler and created a new task with the following settings:

    Security Options - I used my own (administrative) user account here, and set to "Run whether user is logged on or not". I checked the box for Run with highest privileges, and then Configure for Windows 7 etc.

    On the Actions tab, I created a new action to Start a Program, and chose the executable for that problem (for my test, I chose the CMD.EXE file since I could easily see if it worked, if it showed as Administrative User).  

    Finally, under Settings I made sure to check Allow Task to be Run on Demand, and "Do not start a new instance".

    When I attempted to save this task, it brought my username up (as it should), but it did not accept my password. Instead it told me that "either the user name is incorrect, the password is incorrect, or the account does not have permission.."   Which is not true. It was my assumption that since I was logged in as a standard user (and hence the Author was a standard user account), that's where the problem lay. 

    Attempt #2 - 

    I logged onto the computer as myself (a local admin). I launched Task Scheduler and created a new task with the following settings:

    Security Options - Again, I used my own (administrative) user account here, and set to "Run whether user is logged on or not". I checked the box for Run with highest privileges, and then Configure for Windows 7 etc.

    On the Actions tab, I created a new action to Start a Program, and chose the executable for that problem (for my test, I chose the CMD.EXE file since I could easily see if it worked, if it showed as Administrative User).  

    Finally, under Settings I made sure to check Allow Task to be Run on Demand, and "Do not start a new instance".

    When I attempted to save this task, it brought my username up (as it should), and it did accept my password. All looked good. I then logged out, and back on as the standard user, and I created a shortcut on the desktop which would run this particular task. When I ran the task, the command prompt window flashed and disappeared. It is my assumption that this is because the task is being run with elevated token, but the standard user cannot see it as a result (not unlike the UAC issue that plagued login scripts in a similar way.)

    Attempt #3 - 

    I remained logged onto the computer as a standard test user. I launched Task Scheduler, but this time I ran Task Scheduler as Administrator (authenticating with my own account) and created a new task with the following settings:

    Security Options - I used my own (administrative) user account here, and set to "Run whether user is logged on or not". I checked the box for Run with highest privileges, and then Configure for Windows 7 etc.

    On the Actions tab, I created a new action to Start a Program, and chose the executable for that problem (for my test, I chose the CMD.EXE file since I could easily see if it worked, if it showed as Administrative User).  

    Finally, under Settings I made sure to check Allow Task to be Run on Demand, and "Do not start a new instance".

    When I attempted to save this task, it brought my username up (as it should), and it did accept my password. All looked good. Since I was still logged on as the standard user, I created a shortcut on the desktop which would run this particular task. When I ran the task, the command prompt window again flashed and disappeared. It is my assumption that this is also the elevated token issue.

    So my question is this - given the above, how exactly would you configure this to run the program while logged on as a standard user, but the program runs as Administrator? Due to strictures from above, it is not an option to change the UAC settings or to save/cache the credentials in the actual shortcut (which I saw as an option earlier). 

    Suggestions would be most welcome.

    --BW

    Wednesday, March 2, 2016 7:59 PM

Answers

  • If this was possible, then everyone could use Task Scheduler to run whatever application.
    If the application requires admin rights and is supposed to be run as a standard user it should handle those requirements itself. You should not solve it. It might be a bug or poorly written code ...


    Best regards George

    Thursday, March 3, 2016 3:03 PM

All replies

  • Hi,

     

    Based on your description, now I am testing the issue but encounter some problems, I need to do more research, could you please wait a moment?

     

    Best Regards,

    Tao


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, March 3, 2016 12:48 PM
  • If this was possible, then everyone could use Task Scheduler to run whatever application.
    If the application requires admin rights and is supposed to be run as a standard user it should handle those requirements itself. You should not solve it. It might be a bug or poorly written code ...


    Best regards George

    Thursday, March 3, 2016 3:03 PM
  • Were you able get this working?
    Thursday, January 25, 2018 2:00 PM