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’
[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 = [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);
}
}
#[Nintex.Workflow.Administration.AuthorisedTypes]::RegisterWorkflowService($WebApplication,$([Nintex.Workflow.Activities.Services.WorkflowInstanceService]).UnderlyingSystemType);
#[Nintex.Workflow.Administration.AuthorisedTypes]::RegisterWorkflowService($WebApplication,$([Nintex.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:
[Nintex.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.
Best answer by DinoForbes
View original