none
Cannot run a Group Policy Preferences - Task Scheduler - Computer task.

    Question

  • I have a task that I need to run when after the user logs on.
    So I created a task in the Computer Configuration\Preferences\Control Panel Settings\Scheduled Task
    I set it so the task only runs when the user is logged on.

    The task generates an error on the workstation when it runs, saying

    The computer 'RunTasks' preference item in the 'Run Tasks {6A1D91BA-7BD6-4FEE-A142-151CCD9123CC}' Group Policy Object did not apply because it failed with error code '0x80070057 The parameter is incorrect.' This error was suppressed.

    It seems to be a problem with the domain\username in the script itself.  It defaults to %LOGONDOMAIN%\%LOGONUSER%, but this doesn't want to run in the computer context.

    I've tried filling it with BUILTIN\Administrators, Administrator, PARK\Bill (My Account), but nothing seems to want to run.
    Any suggestions?

    If I put the same script in the UserConfiguration\Preferences\... location, it will run fine, I think because, it then has values for %LOGONDOMAIN% & %LOGONUSER%.  But I don't want the task to run only for specific users, I want it to run for specific computers.

    This is Server 2012R2, and a Windows 10 Workstation.


    • Edited by Bill Tkach Tuesday, October 11, 2016 11:04 PM
    Tuesday, October 11, 2016 10:49 PM

Answers

All replies

  • Hi Bill Tkach,

    >I have a task that I need to run when after the user logs on.

    Please check if the script could be run without issue if you add it in logon script under Computer Configuration:

    Best Regards,

    Anne


    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.

    Wednesday, October 12, 2016 6:26 AM
    Moderator
  • > If I put the same script in the UserConfiguration\Preferences\...
    > location, it will run fine, I think because, it then has values for
    > %LOGONDOMAIN% & %LOGONUSER%.  But I don't want the task to run only for
    > specific users, I want it to run for specific computers.
     
    Then run it in user configuration, but enable Item Level Targeting.
    "Security Group - Computer is a member of" should fit your needs :)
     
    Thursday, October 13, 2016 12:15 PM
  • Hi Bill Tkach,

    Could the above replies be of help to you? If yes, you may mark useful as answer, if not, feel free to feed back.

    Best Regards,

    Anne


    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.

    Friday, October 14, 2016 1:46 AM
    Moderator