How to add user to ad group through workflow

spandana kalla
Tera Contributor

Hello Community,

How to add user to AD group through workflow. My actual requirement is a task will be created to one particular DL group. If once tasks gets closed complete, the user should get added to AD group. I have created that task which was mentioned in 1st point. Can anyone please say how to add user to ad group. Please help me with this .

@Ankur Bawiskar 

Requirement :

  1. Once the business stakeholder approves a task needs to be created for the security team to assign the correct role permissions. The description for the task should read. “Please assign the user to the indicated role.”
  2. After this task is closed complete, the user should be added to AD group.

 

10 REPLIES 10

Pullela Sony
Tera Guru

Hi,

Please add one Run script after task is closed complete.

Below is the script:

var memberRec = new GlideRecord('sys_user_grmember');
memberRec.initialize();
memberRec.user = current.variables.requested_for;
memberRec.group = 'sysid';// give group sysid
memberRec.insert();

Thank you

Sony

 

 

 

Hello sony,

After the task for security team there is a activity like completed set closed values is that activity for task closed complete? @Pullela Sony 

Thanks,

If you want to add group to user after task completed then keep in between catalog task and set values activities  or else after set value activity

after adding run script i added two conditions where exactly i should give path to success and failure . can u please say . @Pullela Sony . please refer the snip below: