While executing below Register-ClusteredScheduledTask i am getting this error.

Register-ClusteredScheduledTask -TaskName $ClusterTaskName -TaskType AnyNode -Xml $TaskXML | Out-Null

Register-ClusteredScheduledTask : The parameter is incorrect.

At C:\Setup-Scheduler.ps1:215 char:5
+     Register-ClusteredScheduledTask -TaskName $ClusterTaskName -TaskT ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: InvalidArgument: (PS_ClusteredScheduledTask:Root/Microsoft/...ed
ScheduledTask) [Register-ClusteredScheduledTask], CimException
+ FullyQualifiedErrorId: HRESULT 0x80070057,Register-ClusteredScheduledTask


<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo />
              <January />
              <February />
              <March />
              <April />
              <May />
              <June />
              <July />
              <August />
              <September />
              <October />
              <November />
              <December />
              <November />

      <Command>C:\Schedulers\CrystalHR\ADMS Download Command\ADMSManualCommand.exe</Command>
      <WorkingDirectory>C:\Schedulers\CrystalHR\ADMS Download Command</WorkingDirectory>

To verify where my XML is correct i used the same xml with below code

Register-ScheduledTask -TaskName "Dummy" -Xml $TaskXML -User "XX\YY" -Password "XXXXX" -Force | Out-Null

and it worked correctly. Then my XML should be correct.

I also tried registering the clustered scheduler task by directly using simple Trigger and Action and even that worked.

Register-ClusteredScheduledTask -TaskName $ClusterTaskName -TaskType AnyNode -Trigger $SingleTaskTrigger -Action $TaskAction | Out-Null

It looks like the my xml which works with standard scheduled task does not work with clustered scheduler task due to some invalid parameter which not documented for clustered task anywhere. Do anyone have a such documentation for the same?

Please help me out.


After running $Error[0] | fl -f got below error

writeErrorStream      : True
OriginInfo            :
Exception             : Microsoft.Management.Infrastructure.CimException: The
                        parameter is incorrect.

                           at Microsoft.Management.Infrastructure.Internal.Oper
                        callbackProcessingContext, T currentItem, Boolean
                        moreResults, MiResult operationResult, String
                        errorMessage, InstanceHandle errorDetailsHandle)
TargetObject          : PS_ClusteredScheduledTask
CategoryInfo          : InvalidArgument: (PS_ClusteredScheduledTask:Root/Micros
                        [Register-ClusteredScheduledTask], CimException
FullyQualifiedErrorId : HRESULT 0x80070057,Register-ClusteredScheduledTask
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      :
PipelineIterationInfo : {0, 1, 0}
PSMessageDetails      :
  • Do you have a corrupted scheduled task? powershell.org/forums/topic/register-scheduledtask This article writes about using set-clusteredscheduledtask rather than registering in case it is already registered. serverfault.com/questions/623407/… Hope this helps. Thanks, Tim.
    – Tim Haintz
    Commented Nov 17, 2016 at 10:44
  • I have already looked into that. I have check with Get-ClusteredScheduledTask and found no task and the cluster is also configured correctly since i am able to create simple task without xml. Commented Nov 17, 2016 at 12:21
  • Could you please duplicate the error and then run the following code: $Error[0] | fl -f. That should provide more detailed info about what's going on. Please update your answer with the result.
    – Colyn1337
    Commented Nov 17, 2016 at 14:25
  • From serverfault.com/questions/623919/… it says that -xml is expecting a string. Thanks, Tim.
    – Tim Haintz
    Commented Nov 18, 2016 at 10:49
  • Thank you for updating with the additional error details. The error is actually from the Task Scheduler and not from Powershell. This means Powershell validated your inputs and passed them to the scheduler which returned the error. You'll need to do additional troubleshooting to track down the cause. This can be from security settings, service hang ups, and even patch level.
    – Colyn1337
    Commented Nov 18, 2016 at 16:47

1 Answer 1


I was able to resolve this issue by choosing a different task name. I have seen this under two circumstances:

  1. I have a scheduled task that has become corrupt. Even deleting it won't free up the task name, it must be cached somewhere.
  2. I had an unsupported character in a task name e.g. /

Both can be resolved by choosing a new name. I've found it useful to try creating an empty task with the name you'd like, as the errors in the GUI are better than a simple CimException.

  • 1
    I got this when I had the "/" in the name. Thanks!!
    – Sako73
    Commented May 1, 2019 at 14:29
  • 1
    "/" in the name +1, thanks.
    – Darkthread
    Commented Jun 23, 2020 at 6:05
  • ":" also unsupported
    – Larsen
    Commented Jan 17, 2023 at 12:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .