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:TempSourceCode.Workflow.Management.dll'
$account = ''
$k2server = ''
$workflowManagementServer = New-Object SourceCode.Workflow.Management.WorkflowManagementServer
$workflowManagementServer.Open("Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=$k2server;Port=5555;SecurityLabelName=K2")
$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
$userPermission.Add($newPermission)
$workflowManagementServer.UpdateOrAddProcUserPermissions($processSet.ProcID, $userPermission)