PowerShell Script Custom Workflow Action


Badge +7

Hi All,

I put together a custom Nintex Workflow action that executes PowerShell script based on Christian Glessners’ Execute PowerShell Script Action which is part of his Advanced Workflow Actions for SharePoint Designer 2010 which you can find on CodePlex.

The following variables are provided to your script:

  • $site = the current Microft.SharePoint.SPSite
  • $web = the current Microft.SharePoint.SPWeb
  • $list = the current Microft.SharePoint.SPList (null in site workflows)
  • $item= the current Microft.SharePoint.SPListItem (null in site
    workflows)
  • $ctx = the current workflow context
    Microsoft.SharePoint.WorkflowActions.WorkflowContext
  • $sharePointService = the current
    Microsoft.SharePoint.Workflow.ISharePointService service
  • $listItemService = the curent Microsoft.SharePoint.Workflow.IListItemService
    service

There are also 5 user variables that can be used as both input and output to your script.  One of the great things about this action is that you can require that all scripts have to be signed, thus preventing your workflow designers from writing any PowerShell they want. This is a farm level setting which means you can have it turned off in DEV but require it in TEST & PROD.

You can also pass in an encrypted string which will be decrypted at runtime which can be used for passwords.  Lastly, you can pass in a Secure Store AppId which will retrieve the credentials from the Secure Store Service at runtime and pass it in as the variable $credential as a
System.Net.NetworkCredentials object.


31 replies

Badge +7

Shoot.  Which version of SharePoint are you using?  We have not tested the activity using SharePoint 2013.

Regards,

Eric

Badge +7

Hi Rene,

I did a complete code search and couldn't find "Nintex WF Demo" in any of the code.  Is this one of your names or the name of your workflow?

Regards,

Eric

Badge +7

Hi Rene,

The $var are optional if you want to send data to the script.  You can remove the action by uninstalling the solution just like any other SharePoint solution (wsp).

Badge +5

Jesus, yes that is correct unless it has changed recently.

Gerard

Badge +2

The current official pricing is EUR 1.499 per (productive) WFE and includes 12 months of technical support and updates during that period.

I encourage you to use of free trial to evaluate the tool.

Userlevel 7
Badge +10

You might give this one a go as well: NTX PowerShell Action - Initial Beta Release

Reply