We are using SP2010. I have prepared a PowerShell script to trigger particular workflow on particular object. Here is the script:

$web = Get-SPWeb "http://url/";
$list = $web.Lists["My list"];
$association = $list.WorkFlowAssociations |Where { $_.Name -eq "Name of Workflow"}
$data = $association.AssociationData
$item = $list.GetItemById(1234)

We have a dev and test sharepoint environment. Our dev environment is a single server installation. The script above can start the workflow but immediately turn to "Failed on start" error (and stopped). By running same script on our test environment, it works perfect.

I checked the ULS log, it indicate my web.config have problem.

RunWorkflow: Microsoft.SharePoint.SPException: An error occurred creating the configuration section handler for System.Workflow.ComponentModel.WorkflowCompiler/authorizedTypes: Could not find file 'C:\Users\devserver1\AppData\Local\Temp\ottgdnfv.dll'. (C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config line 683)

I have compared the web.config file between two environment and they are the same.

The same workflow can be triggered manually (on both environment) without problem.

  • are you by any chance running this command with System Account ? It wont work with that. – Gautam Sheth Apr 18 '18 at 8:32
  • I have tried change the script to impersonate a site collection admin and then a normal user. The workflow initiator changed to new person but still same error. – Mark L Apr 18 '18 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.