Permissions needed to run UpdateOrAddProcUserPermissions

  • 19 November 2020
  • 1 reply

Badge +1

Need help on what permissions are required to use UpdateOrAddProcUserPermissions under SourceCode.Workflow.Management.WorkflowManagementServer namespace. Everytime I run this it gives me an error that my account does does not have Administrator rights. However I’m definitely an admin, I do have Admin permission under Server Rights and Admin permission on the workflow that I’m trying to modify the permissions.

Below is the code I’m using, this is in powershell.

Add-Type -Path 'D:\Temp\SourceCode.Workflow.Management.dll'

$account = ''
$k2server = ''

$workflowManagementServer = New-Object SourceCode.Workflow.Management.WorkflowManagementServer

$newPermission = New-Object SourceCode.Workflow.Management.ProcSetPermissions
$newPermission.ProcSetID = $processSet.ProcID
$newPermission.Admin = $true
$newPermission.UserName = $account
$newPermission.ProcessFullName = $processSet.FullName

$userPermission = New-Object SourceCode.Workflow.Management.Permissions

$workflowManagementServer.UpdateOrAddProcUserPermissions($processSet.ProcID, $userPermission)


1 reply

Badge +1


Passing ProcSetID instead of ProcID solve the problem. It was that simple all along :scream: