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:
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’
foreach ($Activity in [Nintex.Workflow.ActivityReferenceCollection]::GetAllActivities())
if([string]::IsNullOrEmpty($Activity.ActivityType) -eq $false)
Write-Output "Activating $($Activity.Name)"
$TypeName = [String]::Empty
$NamespaceName = [String]::Empty
#[Nintex.Workflow.Common.Utility]::ExtractNamespaceAndClassName($Activity.ActivityType, [ref]$TypeName, [ref]$NamespaceName)
#[Nintex.Workflow.Administration.AuthorisedTypes]::InstallAuthorizedWorkflowTypes($WebApplication, $Activity.ActivityAssembly, $NamespaceName,$TypeName);
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:
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.
Solved! Go to Solution.
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.