none
Scheduling a task with GPO to run as admin when user is logged

    Question

  • I've been stumped by this for over a week now and read plenty of similar but not identical threads.

    I have used Group Policy to scheduled a task.  The task, which is set to run as domain admin, triggers a bat file which queries the registry and decides to run an exe.  

    This above works perfectly when I set up the task as admin on a 'user config' GPO and log into machine as admin.   However, when I log into a user's machine as the user, the task runs but the bat script is not triggered.  I've had tried a few scenarios to troubleshoot this to no avail:

    When I set a GPO under 'user config' and set the task to run as a specific user, the task runs perfectly but its not viable to iterate this method.

    When I set a GPO under 'computer config' and set the task to run as a SYSTEM, the task runs but does not trigger the bat script. 

    Selecting whether 'user is logged in or not' does not affect the success of the above scenarios.

    Wednesday, June 17, 2015 6:20 PM

Answers

  • Hi,

    Please be awear the below security context when you choose different account or configration:

    If the preference item is part of Computer Configuration , by default the task is run in the security context of the SYSTEM account.

    If the preference item is part of User Configuration, by default the task is run in the security context of the logged-on user. The task is run only if the user is logged on to the computer, but can continue after the user logs off.

    If you selected run the task regardless of whether user is logged in or qould run the task under the security context of the specified account.

    I can see that you mentiod the task would trigger a bat file which querey the registry,please double confirm the account you use has the permission to read the registry.

    Best Regards,

    Elaine 


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

    Thursday, June 18, 2015 7:58 AM
    Moderator