You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In function GetRegisterParam you are creating a Principal and trying to pass it to Register-ScheduledTask using an Object parameter set. This does not work, Principal parameter in your call is omitted!
You need to call Register-ScheduledTask with Principal parameter set to make it work correctly, like:
return @{
TaskName = $TaskName
TaskPath = $TaskPath
Action = $scheduleTaskParam.action
Trigger = $scheduleTaskParam.trigger
Settings = $scheduleTaskParam.settings
Principal = $scheduleTaskParam.principal
Description = $scheduleTaskParam.description
}
I discovered this because I needed my task to run in interactive mode, so with LogOnType = "Interactive".
Can you please add also a paraameter that will allow to specify the LogOnType?
The text was updated successfully, but these errors were encountered:
I have to admit that your resource was so far the best I have seen. If you could add "LogOnType" as a parameter it would allow me to use the official version instead of my own hacked copy. LogOnType is one of the options on first task tab so I am sure that it will be not only me who will want to use it:)
Hi,
According to Technet there are 4 possible set of parameters in Register-ScheduledTask: User, Object, Principal and xml (link: https://technet.microsoft.com/en-us/library/jj649811(v=wps.630).aspx)
In function GetRegisterParam you are creating a Principal and trying to pass it to Register-ScheduledTask using an Object parameter set. This does not work, Principal parameter in your call is omitted!
You need to call Register-ScheduledTask with Principal parameter set to make it work correctly, like:
return @{
TaskName = $TaskName
TaskPath = $TaskPath
Action = $scheduleTaskParam.action
Trigger = $scheduleTaskParam.trigger
Settings = $scheduleTaskParam.settings
Principal = $scheduleTaskParam.principal
Description = $scheduleTaskParam.description
}
I discovered this because I needed my task to run in interactive mode, so with LogOnType = "Interactive".
Can you please add also a paraameter that will allow to specify the LogOnType?
The text was updated successfully, but these errors were encountered: