activity workflow - powershell activity throwing Index was out of range

FIM WAL is calling a powershell activity. After the activity is called, search requests throws " this workflow instance encountered an internal error during processing". In event viewer, I could see this error. I even tried with empty try catch statement. Iit's giving the same error.

param($oid,$fname,$AcctName,$lname)
try
{
$line = "test"
}
catch [System.Exception]
{
 return "bad value"
}

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
   at FIM.Workflow.Common.Activities.RunPowerShellScript.RunScript(String script, ArrayList arguments, Dictionary`2 parameters)
   at FIM.Workflow.Common.Activities.RunPowerShellScript.Run_ExecuteCode(Object sender, EventArgs e)
   at System.Workflow.ComponentModel.Activity.RaiseEvent(DependencyProperty dependencyEvent, Object sender, EventArgs e)
   at System.Workflow.Activities.CodeActivity.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run()

March 24th, 2015 1:10pm

Which PowerShell activity are you using?
There are three listed at CodePlex: http://www.codeplex.com/site/search?query=fim%20powershell%20activity&ac=3

You may have better luck using one of the others.
The one written by Craig Martin seems to work well:
http://fimpowershellwf.codeplex.com/

Free Windows Admin Tool Kit Click here and download it now
May 6th, 2015 11:55am

David,

I am using FIM WAL  - powershell activity that comes out of the box with FIM portal. The simple powershell runs fine and I am getting the output as expected. But in FIM search logs and windows event viewer, I am getting errors as mentioned above.

June 3rd, 2015 8:59pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics