Qlik Community

QlikView Management

Discussion Board for collaboration on QlikView Management.

Highlighted
MVP
MVP

QMS API, add/remove AD user to Publisher task

Is there a way to add/remove Recipients (user in Windows AD) to an already defined task (on a source document) using the QMS API (not from QMC console)?

crf.png

7 Replies

Re: QMS API, add/remove AD user to Publisher task

Hi,

Check if this helps

Qlikview Server CAL Manager

Regards

ASHFAQ

borisman
Contributor III

Re: QMS API, add/remove AD user to Publisher task

Massimo, have you figured out a way to do that? I have the same question

Not applicable

Re: QMS API, add/remove AD user to Publisher task

To add:

DocumentTask task = qms.GetDocumentTask(theTaskGuid, DocumentTaskScope.All); \\theTaskGuid needs to be assigned
DirectoryServiceObject item = new DirectoryServiceObject();
item.Type = DirectoryServiceObjectType.Named;
item.Name = @"DOMAIN\USER"; \\Change to the user
item.OtherProperty = @"DOMAIN\USER"; \\Change to the user
task.Distribute.Static.DistributionEntries[0].Recipients.Add(item); \\Just taking Index 0 here for this sample
qms.SaveDocumentTask(task);

To remove:
DocumentTask task = qms.GetDocumentTask(theTaskGuid, DocumentTaskScope.All); \\theTaskGuid needs to be assigned
task.Distribute.Static.DistributionEntries[0].Recipients.RemoveAt(0);  \\Just taking Index 0 and 0 here for this sample
qms.SaveDocumentTask(task);

borisman
Contributor III

Re: QMS API, add/remove AD user to Publisher task

thanks, Magnus! and I still need to republish the document after users are added this way, right?

Not applicable

Re: QMS API, add/remove AD user to Publisher task

Correct. This is just the defintion of the task. You then need to run the task to give the added user access.

borisman
Contributor III

Re: QMS API, add/remove AD user to Publisher task

makes sense, thanks Magnus!

sorin
New Contributor II

Re: QMS API, add/remove AD user to Publisher task

hi ,

did you try to use windows rights ?