I'm attempting to use the TaskService library (because it offers some functionality missing in the native PoweShell cmdlets for Scheduled Jobs) to update a scheduled task with a 'Zero' timespan which should disable the 'Stop the task if it runs longer than' setting however when I call the 'RegisterChanges' method I get the following exception:
Exception calling "RegisterChanges" with "0" argument(s): "The name provided is not a properly formed account name."
...
+ $task.RegisterChanges()
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SecurityException
Any ideas? Given the error message I've tried updating the scheduled task with the Library using both a local admin account and with a domain account that has local admin rights on both a Windows 7 Desktop and a Windows Server 2008 R2 system but I get the same exception in both environments for both accounts.
Thanks in advance,
Ryan
Comments: The comment on the exception is "Tasks which have been registered previously with stored passwords must use the TaskFolder.RegisterTaskDefinition method for updates." I'm not sure why that comes through to PowerShell the way it does, but that is likely the problem.
Exception calling "RegisterChanges" with "0" argument(s): "The name provided is not a properly formed account name."
...
+ $task.RegisterChanges()
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SecurityException
Any ideas? Given the error message I've tried updating the scheduled task with the Library using both a local admin account and with a domain account that has local admin rights on both a Windows 7 Desktop and a Windows Server 2008 R2 system but I get the same exception in both environments for both accounts.
Thanks in advance,
Ryan
Comments: The comment on the exception is "Tasks which have been registered previously with stored passwords must use the TaskFolder.RegisterTaskDefinition method for updates." I'm not sure why that comes through to PowerShell the way it does, but that is likely the problem.