cancel
Showing results for 
Search instead for 
Did you mean: 

NTX PowerShell Action - Stable Release

Workflow Hero
30 56 14.3K

NTX PowerShell Action - Stable Release

Features

  • Robust security features based on Windows Remote Management.
  • Ability to execute PowerShell scripts from any machine allowing Remote Management from your SharePoint servers.
  • PowerShell exceptions are handled so workflows are unaffected.
  • OpenSource
  • Actively Developed
  • Automated Installation Routine

Planned Features

  • Async PowerShell script execution
  • Script Repository
  • Run worker as a centralized SharePoint service instead of in Workflow Infrastructure
  • Pass SPServer object to PowerShell session for determining executing server.

Current roadmap/planned features can be found here.

Downloads

Disclaimer: As stated in our Terms of Use, Nintex is not responsible for any third-party content made available for download on Nintex Connect, whether or not this content has been reviewed and/or moderated by Nintex and regardless of who originated that content (including, but not limited to, Nintex employees, partners, affiliates, or moderators).  Users shall assume all risks associated with applications and other content provided on Nintex Connect.  Nintex does not provide support for any content and plugins provided for download at communities.nintex.com.

NTX - Home

Source Code

Source Code (Archive)

Source Code on Github

Screen Shots

NTXPS_Screenshot.png

screenshot.jpg

56 Comments
Workflow Hero

Hi Aaron,

First, thanks for this project. It's just what i needing.

But I've two questions :

1. In the documentation you mention NTX.PowerShell.wsp but in the downloaded file is PSAdapter.wsp.  What is correct ?

2. I already wrote the script in a ps1 file. Can i call this script in the action or must i write all the code in  the configure action windows ?

Thanks for your reply.

Didier

Workflow Hero

Hi, I have installed this on our development environment and all is working OK. We have SP2013 on prem. However, on our production environment the workflow is returning an error when it gets to the PowerShell action.

Returns the following error:

Error executing PowerShell Unrecognized activity encountered: PS Activity.Activity.

Any ideas how to resolve?

Workflow Hero

Hi guys,

Here are the answers,

1. The correct file name is PSAdapter.wsp (from the download file). The installation works fine and it's very easy (Thanks to Aaron for that).

2. Yes you can call a script directly in the action. And as me, pass the variables, constants, etc... from the workflow as command line parameters of your script.

Have a nice day.

Didier

Workflow Hero

Not sure how I missed these questions (from you and Darren). Thanks for replying back with the answers!

Workflow Hero

Hi Darren,

I would try removing the action from the production environment and re-adding it. Note: You may need to delete the duplicate record from the Activities table in the Nintex Configuration database.

Did you run the install as the Farm Installation account? If not, I would recommend doing that as any other account may not have the necessary permissions to accomplish all of the things the script does.

Hope this helps!

Workflow Hero

Appears it was the scanner software! Its service needed re-starting after adding the powershell action and allowing on the web app.

I believe due the scanner software set up having a ref in it's config file to the web app.

Workflow Hero

Ahhhhh okay, thanks for the update! Let us know if you run into any other hiccups.

Workflow Hero


Hi Eric,

Iam basically stuck at the same Problem. My script runs fine directly on the Server, but once i try executing it from the NTX-Action i get no result back.

I know the powershell-action basically works (tried it with a simple Get-Random and got a value back).

Did you make any progress in solving the problem?

Cheers

Nils

Workflow Hero

Hello everyone,

I ran the installer and made sure my scenario matched the install requirements. However, I do not see the powershell action. I tried to look for it in our manage allowed actions but I don't see it there either. Am I missing something?

Workflow Hero

Hi William,

Have you ran the installation as SP Farm Administrator ?

I had the same problem, because the first time I had ran as site collection administrator, but it is not enough.

Workflow Hero

Thanks for that great Tool. I have used that in Nintex 2013. Works that also with Nintex Workflow 2016 and Sharepoint 2016?

Have some experiance with that?

Workflow Hero

Hi,

Does this work in Office365?  If not, are you aware of any PowerShell Actions that would work in Office365?

Workflow Hero

Hi Aaron,

great idea to create PowerShell action for Nintex.

I have a question. How can I pass the workflow variables to this action?

Nintex does not have a inline function for strings to be URL encoced, thus provides to use this action.

I wrote this script below unfortunately, I can not pass a workflow variable to Powershell variable.

[string]$inputString = {WorkflowVariable:inputString}

if (![string]::IsNullOrEmpty($inputString)){
    function htmlEncode{
        $encodedInputString= [System.Web.HttpUtility]::UrlEncode($inputString)
        return $encodedInputString
    }
    htmlEncode
}else{
    function htmlEncode{
        return "Input value is empty!!!"
    }
    htmlEncode
}

Any Ideas?

Workflow Hero

Hey Eric,

It does not work in O365 as of yet. This could be written however, you would need to deploy some bits to an Azure subscription.

Cheers!

Workflow Hero

It is not compiled for any platform but 2013 at the moment.

Workflow Hero

You should be able to use variables in your PowerShell scripts. try output $inputString, does it spit anything out in the return value?

Additionally, you might consider using this web service with the Web Request action instead: http://aaronlabiosa.com/url-encode-decode-rest-endpoint/

Workflow Hero

Hi Aaaron,

thanks for the quick response and for the link. Web service for URL encoding is also an option. Nevertheless, I would like have this PowerShell Action functional because it offers many other options for use.

Look at my test workflow, maybe something I'm doing wrong.

There are four actions:
1)      Set variable as "Hello world!!!"
2)      PowerShell action (actually only for testing input variable)
3)      Log in History List to log output variable "powerShellOutput" in workflow History
4)      Send notification to get output variable in e-mail

01.png

When I tried to define PowerShell variable $inputString inside in PowerShell action, it returned me value to Result Output variable "powerShellOutput".

[string]$inputString= "Hello world!!!"

function htmlEncode{

    return $inputString

}

htmlEncode

02.png

When I tried to pass workflow variable "{WorkflowVariable:inputString}" to PowerShell variable "$inputString" it returned me blank row (as you can see quotes at the picture) to Result Output variable "powerShellOutput".

[string]$inputString= {WorkflowVariable:inputString}

function htmlEncode{

    return $inputString

}

htmlEncode

03.png

Am I doing something wrong?

Workflow Hero

OK, I found my mistake.

Workflow variable needs to be closed in quotes [string]$inputString = "{WorkflowVariable:inputString}".

Thanks

Workflow Hero

You might try running that code in a WinRM session instead of right in the action. A WinRM session should emulate what the action does on the back end.

Cheers!

Aaron

Workflow Hero

I have successfully deployed the custom action on SharePoint 2016 with Nintex Workflow 2016, but I cannot seem to activate it to more than one web application. Is there something within Nintex that I am not doing right? I am certain this action should work on every web application in my farm, not just one!

Workflow Hero

Has anyone had issues with the 'SSL Enabled' button not stay staying checked? When saving action the SSL Enabled button does not stay checked.

Workflow Hero

Hi Michelle,

The action was not compiled for SharePoint2016 (unless someone has forked the project). The fact that the action works at all on 2016 is fairly impressive in my opinion! Is the one Web Application that it functions on one that was migrated from SharePoint 2013 by chance?

Cheers!

Workflow Hero

You could open a bug on the codeplex project site for this.

Workflow Hero

Yes. It does take a few saves for it to stay. I have seen this, too.

Workflow Hero

Yes, Aaron. The web application that works contains site collections in a content database created natively in SharePoint 2016. The place it is not working is a site collection in a content database upgraded from SharePoint 2013. I have checked to make sure the site collection/content database does not require upgrade. Does the fact that this was an upgraded database make a difference?

Workflow Hero

I am not sure, but it would certainly appear so. Does everything else function correctly in the legacy sites?

Cheers!

Aaron

Workflow Hero

Actually, no. I just tried to query for some other native Nintex action and I am getting the same thing I see with the Powershell action. What does it mean to "Contact your administrator to enable"? If I know how to do this, I think I can get the Powershell custom action working, too. I cannot find instructions on how to resolve this.

Thank you for your attention!

additional_actions.PNG

Workflow Hero

In Central Administration there should be a section where you can manage Nintex Actions. I suspect that you need to click the checkboxes for the actions that you wish to enable for the farm.

Note: You should be able to break permission inheritance for this at various stages of the hierarchy if you need more granular control later on.

Not applicable

Dear ,

 Am getting the following error in my farm

============================================

System.Management.Automation.PSInvalidOperationException at System.Management.Automation.Remoting.Client.WSManClientSessionTransportManager.Initialize(Uri connectionUri, WSManConnectionInfo connectionInfo) at System.Management.Automation.Remoting.Client.WSManClientSessionTransportManager..ctor(Guid runspacePoolInstanceId, WSManConnectionInfo connectionInfo, PSRemotingCryptoHelper cryptoHelper, String sessionName) at System.Management.Automation.Remoting.ClientRemoteSessionDSHandlerImpl..ctor(ClientRemoteSession session, PSRemotingCryptoHelper cryptoHelper, RunspaceConnectionInfo connectionInfo, URIDirectionReported uriRedirectionHandler) at System.Management.Automation.Remoting.ClientRemoteSessionImpl..ctor(RemoteRunspacePoolInternal rsPool, URIDirectionReported uriRedirectionHandler) at System.Management.Automation.Internal.ClientRunspacePoolDataStructureHandler..ctor(RemoteRunspacePoolInternal clientRunspacePool, TypeTable typeTable) at System.Management.Automation.Runspaces.Internal.RemoteRunspacePoolInternal.CreateDSHandler(TypeTable typeTable) at System.Management.Automation.Runspaces.RunspacePool..ctor(Int32 minRunspaces, Int32 maxRunspaces, TypeTable typeTable, PSHost host, PSPrimitiveDictionary applicationArguments, RunspaceConnectionInfo connectionInfo, String name) at System.Management.Automation.RemoteRunspace..ctor(TypeTable typeTable, RunspaceConnectionInfo connectionInfo, PSHost host, PSPrimitiveDictionary applicationArguments, String name, Int32 id) at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(RunspaceConnectionInfo connectionInfo, PSHost host, TypeTable typeTable, PSPrimitiveDictionary applicationArguments) at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(RunspaceConnectionInfo connectionInfo) at PSActivity.PSHelper.CreatePowerShellRunspace(Boolean UseSSL, String Computername, Int32 Port, String AppName, String ShellUri, String UserName, String Password) at PSActivity.Activity.Execute(ActivityExecutionContext executionContext)
Not applicable

Above is my action screenshot

Workflow Hero

Try replacing localhost with the machine name.

Cheers!

Aaron

Workflow Hero

We have the same Problem We cant call SharePoint Objects:

Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.
    + CategoryInfo          : InvalidData: (Microsoft.Share....SPCmdletGetWebSmiley FrustratedPCmdletGetWeb) [Get-SPWeb], SPCmdletException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetWeb

Did you find any solution

Workflow Hero

Does this solution require PSRemoting?

Workflow Hero

Hi Richard,

This solution requires Microsoft WinRM framework to function.

Workflow Hero

Any plans to move this project elsewhere when codeplex shuts down? or should I save my copy in my virtual safebox?

Workflow Hero

Hi

any chance to get this working with nintex 2016 ?

Workflow Hero

But what do I insert in the "PowerShell Script" richt text box, when my PS script is laying on the server?

 already tried:

C:\Folder\Subfolder\Script.ps1 -Param1 "NintexWFVar"  -Param2 "NintexWFItemProp"

...but nothing happens.

I hope u understand what I mean.

Can somebody give me a hint please?

Greets Martin

Workflow Hero

I my powershell script I have....

Function myFunc

{

....do something....

}

Export-ModuleMember -function myFunc

Then in the workflow action i do:

Import-Module -name c:\fullpath\file.name myFunc -param1 "value" -param2 "value"

/Martin

Workflow Hero

Thanks for the fast reply.

Unfortunately this does not work in my case and I am not getting any errors.

When I simply open the shell on the server and paste C:\Folder\Subfolder\Script.ps1 -Param1 "NintexWFVar"  -Param2 "NintexWFItemProp", the script will execute as expected.

Could it be any reason my script is designed?

This is my script::

param(
    [string]$DestWebURL,
    [string]$PCGroup,
    [string]$ProductName
)
if(!(Get-PSSnapin Microsoft.SharePoint.PowerShell -ea 0))
{
Write-Progress -Activity "Loading Modules" -Status "Loading Microsoft.SharePoint.PowerShell"
Add-PSSnapin Microsoft.SharePoint.PowerShell
}
function AddFileShareLink{
    #Get Web
    $w = Get-SPWeb $DestWebURL
    #Get Placeholder
    $node = $w.Navigation.Quicklaunch | where {$_.Title -eq "FS2Link Placeholder"}
    
    #Check Placeholder Existence
    if($node){
        #Build FS-Link
        $fsLink = "file://fs2srv/_SP_Product_Center/" + $PCGroup + "/" + $ProductName
        $fsLinkName = "FS2SRV " + $ProductName;
        $fsNode = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode($fsLinkName, $fsLink)
        
        #Add to Quicklaunch
        $w.Navigation.Quicklaunch.AddAsLast($fsNode)
        #Move New Node Position
        $fsNode.Move($w.Navigation.QuickLaunch, $node)
        $node.Delete()
    }
}
AddFileShareLink

Workflow Hero

Hi

Don't know if you got it working in the meantime, but I realize I forgot to mention my script is in a .psm file, powershell script module, and please pay notice to the -ExportModuleMember after the main function.

Workflow Hero

Hi Martin,

Thanks for your reply. I tested a simple Script which accesses the SP PS CMD-Lets and should just return me the list count of the website.

I tried it with a normal *.ps1 and your variation as ps module, but both weren´t working.

Here is the module code:

Param(
    [string]$Url
)

function TestMe{
Add-PSSnapin Microsoft.SharePoint.PowerShell

$w = Get-SPWeb($Url)
$count = $w.Lists.Count

return $count
}
Export-ModuleMember -function TestMe

Here the line i wrote in the ntx wf action:

Import-Module -Name C:\Batch\TestMe.psm TestMe -Url "http://intranet"

The funny thing at this point is, when i only let the action return the SPWeb-Object, it works:

But trying to access the properties of the SPWeb object is never working. Can anyone explain this?

Workflow Hero

Hi Aaron Labiosa‌,

I am getting an error message when I publish my workflow where I have added a PowerShell Action. Do you know how to solve this problem?

soapSmiley FrustratederverServer was unable to process request. --> Failed to

publish workflow: <Error> <CompilerError Line="0" Column="10"

Text="The type or namespace name 'PSActivity' could not be

found (are you missing a using directive or an assembly

reference?)" /><CompilerError Line="315" Column="16"

Text="The type or namespace name 'PSActivity' could not be

found (are you missing a using directive or an assembly

reference?)" /><CompilerError Line="237" Column="16"

Text="The type or namespace name 'PSActivity' could not be

found (are you missing a using directive or an assembly

reference?)" /><CompilerError Line="204"

Text="The type or namespace name 'PSActivity' could not be

found (are you missing a using directive or an assembly

reference?)" /><CompilerError Line="200" Column="16"

Text="The type or namespace name 'PSActivity' could not be

found (are you missing a using directive or an assembly

reference?)" /><CompilerError Line="132" Column="16"

Text="The type or namespace name 'PSActivity' could not be

found (are you missing a using directive or an assembly

reference?)" /><CompilerError Line="113" Column="16"

Text="The type or namespace name 'PSActivity' could not be

found (are you missing a using directive or an assembly

reference?)" /></Error>

Thanks.

Workflow Hero

Hey Aaron Labiosa‌,

we have a problem to deploy the custom action at our farm (SharePoint 2013).

We try to deploy it with the farm administrator.

The problem is, that in the downloaded "ntx"-zip-file isn't the powershell script or a .wsp-file.

I found the powershell script in the wiki, but as I said, there isn't a wsp-file aynwhere.

Can you or someone else please help us?

Workflow Hero

Hi Guys,

I'm stuck at the same exact spot... get-spweb doesn't seem to return anything through the action.  Where you able to figure this out?

Thanks

Mike

Workflow Hero

The same functionality available in O365? Or any other alternatives for the same in Nintex O365? 

Workflow Hero

I was able to get it working, it comes down to having the right DB permissions.

Workflow Hero

Only on prem as far as this action goes. 

Workflow Hero

Thanks. No other alternatives to using PowerShell script in Nintex O365 workflow?

Workflow Hero

Hey ‌,

have you found a solution for the missing wsp/installer?

Workflow Hero

Hey ‌,

unfortunately no.