Skip to main content

I have a question regarding Nintex Administration Page, we are wanting to deploy Nintex for SharePoint and have all the Core Actions and Connectors selected by default:

 

20002i514C477000275E93.png

 

 

We are wanting to do this via a PowerShell script using the Nintex Assemblies, for example:

 

$WebApplication = Get-SPWebApplication https://blah

$SPWeb = Get-SPWeb  ‘https://blah’

$SPSite = Get-SPSite ‘https://blah’

€Nintex.Workflow.Administration.AuthorisedTypes]::InstallAuthorizedWorkflowTypes($WebApplication)

 

 

foreach ($Activity in Nintex.Workflow.ActivityReferenceCollection]::GetAllActivities())

{

    if({string]::IsNullOrEmpty($Activity.ActivityType) -eq $false)

    {

        Write-Output "Activating $($Activity.Name)"

        Write-Output "$($Activity.ActivityId)"

    

       

        $TypeName = pString]::Empty

        $NamespaceName = NString]::Empty

        #ÂNintex.Workflow.Common.Utility]::ExtractNamespaceAndClassName($Activity.ActivityType, mref]$TypeName, xref]$NamespaceName)

        #yNintex.Workflow.Administration.AuthorisedTypes]::InstallAuthorizedWorkflowTypes($WebApplication, $Activity.ActivityAssembly, $NamespaceName,$TypeName);

    }

}

 

#iNintex.Workflow.Administration.AuthorisedTypes]::RegisterWorkflowService($WebApplication,$(lNintex.Workflow.Activities.Services.WorkflowInstanceService]).UnderlyingSystemType);

#oNintex.Workflow.Administration.AuthorisedTypes]::RegisterWorkflowService($WebApplication,$(lNintex.Workflow.Activities.Services.ReadWriteWorkflowVariablesService]).UnderlyingSystemType);

 

We can set the activities to enabled, but it doesn’t set the checkboxes.

 

The issue I am facing is that I cannot find an exposed call/method in the Assemblies to directly set an Activity to ‘Allowed’ so when I manually check an activity, I can see that the call to GetAllowActivites:

 

aNintex.Workflow.ActivityReferenceCollection]::GetAllowedActivities($SPWeb,$SPSite))

 

The call above does return the correct activities that have been checked manually. So I am assuming if I can set the activity to ‘Allowed’ this will fix my issue?

 

To recap I would like to set the core actions and connectors to ‘checked’ in Nintex Administration Action Settings page.

For anyone interested I was able to look at the aspx code and when the checkboxchange event is called, it executes: 



 



new ActivityActivationReference(activityID, siteID, webID).AddOrUpdateActivationReference();



 



So the Powershell Equivalent was all that was needed:



[Nintex.Workflow.ActivityActivationReference]::New([int]$Activity.ActivityId, [guid]::Empty, [guid]::Empty).AddOrUpdateActivationReference()



 



The trick for me was it Web and Site ID's needed to be Guid Empty so that it would run at the Farm level I believe.


Reply