RunAs - getting errors

Dec 19, 2014 at 12:02 AM
Hello all!

I have installed version 2.0 of the FIM.PowerShell.Workflow.Activities module.

I have it working in much the same capacity as I had 1.0 working - that being I can't get it to RunAs another user.

If I specify another user in the script (which I'd rather not do...) I am able to execute commands as another user.

If I specify to run as the Requestor it usually works. Sometimes I get an error.

If I specify an account to RunAs, when I press Save in the workflow configuration screen, FIM crashes.

So my questions are:
  1. The release notes for 2.0 say that the encryption string is stored in two config files. Is something I have to configure myself? If so, what is the format of the string?
  2. Why do I get the following error if I execute two workflows in close succession. The first one seems to work, but the second fails:
System.InvalidCastException: Unable to cast object of type 'System.Security.Principal.GenericIdentity' to type 'System.Security.Principal.WindowsIdentity'.
at FIM.PowerShell.Workflow.Activities.PowerShellRunAsRequestor.Invoke(Action action)
at FIM.PowerShell.Workflow.Activities.PowerShellActivity.Execute(ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor1.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()