Tasks can contain a principal (especially a gMSA) which does not need a password, but may run without being logged in.
To import those tasks, the -User parameter must be omitted in Register-ScheduledTask.
I made a PR to change the Install-WindowsScheduledTask to accomodate for empty usernames, but I'm no "task developer" and struggle to make changes to allow empty usernames.
Also you can just call my request out-of-scope, then I'll fallback to some powershell module.
Tasks can contain a principal (especially a gMSA) which does not need a password, but may run without being logged in. To import those tasks, the
-User
parameter must be omitted inRegister-ScheduledTask
.I made a PR to change the
Install-WindowsScheduledTask
to accomodate for empty usernames, but I'm no "task developer" and struggle to make changes to allow empty usernames.Also you can just call my request out-of-scope, then I'll fallback to some powershell module.