The above error can appear when you try to create/modify a scheduled task to run as a specific user (schtasks /CHANGE /TN <task name> /RU <user> /RP <password>)
The cause of the error is a specific security policy on the machine.
It can be resolved via either the Local Group Policy Editor, or the Registry Editor (which is handy if you want to script it).
Local Group Policy Editor
set the following value to ‘Disabled‘ in the local group policy editor:
Security Settings | Local Policies | Security Options | Network access: Do not allow storage of passwords and credentials for network authentication
You don’t need to reboot/relogin – simpy run the command to create/update the task.
You can change the value back to ‘Enabled‘ immediately after, and again, no need to reboot/relogin.
SETTING: 0 – disabled, 1 – enabled
Here, as well, no need to relogin or reboot in order for the change to take effect.