Join GitHub today
windows_task incorrectly requires password when defining a task for the current user #7834
A scheduled task can be successfully defined (and runs) using the "schtasks" command via a powershell_script resource:
However when I try to define the task using the windows_task resource, I get the error referenced in the Client Output.
Those are standard Windows Environment variables.
I'd rather not post the real values, but, here is some more information and examples:
So the full string becomes
You should provide
windows_task resource requires the password to be provided for non SYSTEM users since the windows_task creates task which runs in non-interactive mode that runs task whether user logged in or not. We currently not supporting task creation without password for non SYSTEM users.
I think the root cause and a possible resolution of this issue is as below but let us first consider the working of IT/NP parameters of SCHTASKS:
On the other hand windows_task resource creates Non-Interactive tasks by default which requires both username and password for a non-system user. This is similar to SCHTASKS but the discrepancy is in the default behavior of their interactive_enabled property.
Hence few validations needs to be modify here to allow a Non-System user to create a task without a password, when