3

Using a non-Administrator (or Administrator) cmd.exe, I enter the following command to create a scheduled task with Administrator credentials admin and P@ssw0rd:

schtasks /CREATE /S %computername% /U admin /P P@ssw0rd /RU SYSTEM /SC ONLOGON /TN SYSTEM_notepad /TR C:\Windows\System32\notepad.exe
ERROR: User credentials are not allowed on the local machine.

However, I get the error message ERROR: User credentials are not allowed on the local machine..

Is it some kind of group policy that prevents credentials from being stored with the scheduled task? If so, how to disable it?

AFAIK: /U and /P specify the account for which to run schtasks, whereas /RU and /RP specify the account for which the task itself is run.

As seen below, admin indeed is a member of the Administrators group:

net localgroup administrators
Alias name     administrators
Comment        Administrators have complete and unrestricted access to the computer/domain

Members

-------------------------------------------------------------------------------
AuraExpressService
di3dh7
admin
The command completed successfully.
Shuzheng
  • 419
  • 1
  • 8
  • 15
  • 1
    Strictly it is a bug in schtasks.exe I found a weird workaround/trick, using the Hosts. file! See https://eskerahn.dk/wordpress/?p=2724 I only tried it with /Query, but would be surprised if it did not handle the other ones as well –  Nov 07 '18 at 14:33
  • Why a downvote? Why comment? The workaround would be as much a 'solution' as many other solutions. Sometimes it seems that help are simply not appreciated... –  Nov 07 '18 at 16:45

0 Answers0