I have a .NET webpage that calls a PowerShell script. The PowerShell script adds a new list item to a SharePoint list and should automatically trigger a SharePoint workflow on add.
When I log into the server as a domain\admin account and run this script directly from the PowerShell window, the item is added to the list and the workflow is kicked off successfully.
However, when I call the same PowerShell script from the .NET webpage, the script is called, the item is added to the SharePoint list, but the workflow is not automatically triggered. The app pool runs as the same domain\admin account that I logged in as to run the script directly - so permissions should be the same.
(I have also tried to programatically call the workflow from the script, with no success.) This is SharePoint 2010, .NET 4.0, PowerShell 64-bit, Windows 2008 R2
Is this a permissions issue? Any ideas?