none
Task Scheduler - Unable to edit my own task? RRS feed

  • Question

  • Hi.

    I am trying to edit a scheduled task, that I created a few months ago. The task opens an FTP client every x mins and uploads a file to a remote server.

    This has been running successfully for about a month - today I wanted to amend the task slightly to change the filename uploaded to the server, and no matter what I try, I can't save the task. It keeps asking for my credentials, which when entered are met with the response "Task Scheduler cannot apply your changes. The user account is unknown, the password is incorrect, or the user account does not have permission to modify the task."

    I have edited the task before without issue, I am using the same account to edit as to create the task. And it is the administrator account for the machine.

    It seems there is a permission issue at play here but I can't figure it out, and I can't think of anything significant that has changed between the last edit of the task, and today - aside from some Windows Updates. Any ideas on how to solve this issue?

    Wednesday, September 18, 2019 11:05 AM

All replies

  • Hi Andy, 

    What's your system build? Please run "winver" to check details.

    It is a domain joined computers? Did you changed any domain environment?

    Try to right click Task Scheduler and open it as administrator to check the issue again.

    Also please check if the issue occur when try to modify other task.

    We could go to C:\Windows\System32\Tasks, then right click your task name and give full control right to your account.

    Please also check to create a new same task and try to modify it. 

    Bests,

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

    Thursday, September 19, 2019 2:21 AM
    Moderator
  • Hi Andy,

    Any update?

    Bests,


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

    Wednesday, October 2, 2019 2:33 AM
    Moderator
  • Good Morning

    I am having the same problem and hope you can help me.  Several months ago I set up four tasks that are running fine.  However, I would like to edit the tasks and I do not have permission to do so, even though I am the administrator and only account on this laptop.

    To answer your questions:

    I am running Windows 10 Ver 1809, OS Build 17763.914

    This is not a domain joined computer and I have not changed any settings

    I tried running as administrator and it makes no difference

    The issue occurs with all four tasks I created

    I have full control right of the account

    I created a new task, modified it, and deleted it with no problem.

    Thank you !

    John

    Wednesday, January 8, 2020 2:55 PM
  • I am having the same problem and hope you can help me.  

    Did you try the suggestion "Try to right click Task Scheduler and open it as administrator to check the issue again."?

    If you can't figure out how to do that, on the taskbar search field type "cmd". It should find the command prompt and one of the options will be "run as administrator". Select that. In the command window run "compmgmt.msc". Try editing the task from there. 

    Wednesday, January 8, 2020 3:40 PM
  • Yes, I tried that, it did not matter.
    Wednesday, January 8, 2020 5:06 PM
  • Open Powershell_ISE and paste in this script. It will display the security descriptors for the tasks. I am curious as to what is defined that prevents Admins from updating the task.

     

     $wmisdh = new-object system.management.ManagementClass Win32_SecurityDescriptorHelper 
     $subkeys = Get-childitem "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree"
     foreach ($key in $subkeys) {
            ''
            $key.PSChildName
            $task = Get-ItemProperty $($key.name).replace("HKEY_LOCAL_MACHINE","HKLM:")
            $sddl = $wmisdh.BinarySDToSDDL( $task.SD ) 
            $sddl['SDDL']        
        
    }

    Run it and look for your 4 tasks. It should look like this below.  Paste the SDDL back to this thread and I will try to translate it. 

    Adobe Acrobat Update Task
    O:SYG:SYD:(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;SY)(A;;FR;;;IU)
    
    GarminUpdaterTask
    O:SYG:SYD:(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;SY)(A;;FR;;;SY)
    
    GoogleUpdateTaskMachineCore
    O:SYG:SYD:(A;;FX;;;SY)(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;BA)(A;;FR;;;SY)
    
    GoogleUpdateTaskMachineUA
    O:SYG:SYD:(A;;FX;;;SY)(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;BA)(A;;FR;;;SY)
    
    KillSkype
    O:BAG:S-1-5-21-3320722524-193523071-2819253668-1001D:(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;BA)(A;;FR;;;S-1-5-21-3320722524-193523071-281925366
    8-1001)
    
    

    Wednesday, January 8, 2020 7:01 PM
  • Get-childitem : Requested registry access is not allowed.

    At line:2 char:13

    +  $subkeys = Get-childitem "HKLM:\SOFTWARE\Microsoft\Windows NT\Curren ...

    +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...\TaskCache\Tree:String) [Get-ChildItem], Security

       Exception

        + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.GetChildItemCommand

    Wednesday, January 8, 2020 8:06 PM
  • Get-childitem : Requested registry access is not allowed.

    At line:2 char:13

    +  $subkeys = Get-childitem "HKLM:\SOFTWARE\Microsoft\Windows NT\Curren ...

    +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...\TaskCache\Tree:String) [Get-ChildItem], Security

       Exception

        + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.GetChildItemCommand

    Sorry about the background colors, i am having trouble getting rid of them

    Wednesday, January 8, 2020 10:37 PM
  • Run Powershell or Powershell_ISE as administrator. You're getting an access denied.
    Wednesday, January 8, 2020 11:45 PM
  • OK.  Here is the result.  Tasks AAA, AAVB, AAC and AAD are the four tasks I created a few months ago and that I can not change.  Task AAE was created yesterday and I am able to modify it.  

    AAA Data Updates

    O:BAG:S-1-5-21-2765318553-591572814-2991623940-1004D:(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;BA)(A;;FR;;;S-

    1-5-21-2765318553-591572814-2991623940-1004)

     

    AAB Data Update VBS

    O:BAG:S-1-5-21-2765318553-591572814-2991623940-1004D:(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;BA)(A;;FR;;;S-

    1-5-21-2765318553-591572814-2991623940-1004)

     

    AAC Data Update  Trampas

    O:BAG:S-1-5-21-2765318553-591572814-2991623940-1004D:(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;BA)(A;;FR;;;S-

    1-5-21-2765318553-591572814-2991623940-1004)

     

    AAD Data Update Personnel

    O:BAG:S-1-5-21-2765318553-591572814-2991623940-1004D:(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;BA)(A;;FR;;;S-

    1-5-21-2765318553-591572814-2991623940-1004)

     

    AAE

    O:BAG:S-1-5-21-2765318553-591572814-2991623940-1004D:(A;ID;0x1f019f;;;BA)(A;ID;0x1f019f;;;SY)(A;ID;FA;;;BA)(A;;FR;;;S-

    1-5-21-2765318553-591572814-2991623940-1004)

    Thank you

    Thursday, January 9, 2020 12:33 PM
  • They all have the same SDDL and that matches (except for my user SID instead of yours) a task from my Win10 laptop.

    Check C:\Windows\System32\Tasks. Look at the file security permissions. Is AAA different than those for AAE?

    Thursday, January 9, 2020 2:58 PM
  • The permissions are exactly the same, including Fill Control, Modify, Read & execute, Read and Write.

    I'd be perfectly happy just deleting these tasks and rewriting them, but i can not even do that.

    Thanks for the effort!

    Thursday, January 9, 2020 3:07 PM
  • Download psexec. https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

    Open an admin command prompt. 

    cd c:\yourfavoritemiscfolder
    schtasks /query /tn aaa /xml > aaa.xml

    Then use psexec to "become" the system.

    psexec \\localhost -s cmd.exe
    whoami
    schtasks /delete /force /tn aaa
    exit 

    Then define the task again.

    schtasks /create /tn AAA /xml aaa.xml


    • Edited by MotoX80 Thursday, February 13, 2020 6:12 PM add /force switch
    Thursday, January 9, 2020 3:26 PM
  • First:  my apologies for the long delay in replying, and thank you for the advice.

    Second:  I've executed the commands,  Whoami  returns "nt authority\system", so far so good.

    here is what I get when I try to delete the task:

    c:\Windows\System32\Tasks>schtasks /delete /tn "AAC Data Update  Trampas"
    schtasks /delete /tn "AAC Data Update  Trampas"
    WARNING: Are you sure you want to remove the task "AAC Data Update  Trampas" (Y/N)? Y
    Y
    ERROR: Invalid input.
    Type "SCHTASKS /DELETE /?" for usage.

    If i try to delete a filename that does not exist, I am told the file does not exist in the system, so I know it is seeing my task file, but it does not execute the delete command.  Any thoughts?  Thank you again for your time.

    Wednesday, January 22, 2020 12:18 PM
  • Add a force switch. 

    schtasks /delete /tn "AAC Data Update  Trampas" /f

    Wednesday, January 22, 2020 2:58 PM
  • Thanks. When i use the force command I get an "ERROR: Access is Denied"
    Monday, January 27, 2020 1:50 PM
  • Wow, if the system can't delete it, you've got something really wrong. My best thought is to run Process Monitor and see if can you find an "access denied" on some file or registry key when you try to delete the task.

    https://docs.microsoft.com/en-us/sysinternals/downloads/procmon

    Have you used procmon? The only real trick is to stop the trace right after the error.  It can capture a lot of data. 

    Monday, January 27, 2020 2:54 PM
  • I will try this, thanks.
    Tuesday, January 28, 2020 11:46 AM
  • I will try this as well
    Tuesday, January 28, 2020 3:04 PM
  • I will try this, thanks.
    Did you find anything in the trace?
    Wednesday, February 5, 2020 1:57 PM