Add User to Group (AD Orchestration Activity) - Not working

mev
Tera Contributor

Hi Everyone,

I'm having an issue adding multiple group memberships to a users AD account via the OOTB Orchestration activity "Add User to Group" for Active Directory.  Here is the failure message in the workflow:

find_real_file.png

In the workflow above, you can see there are 2 previous activities.  The first script compiles the list of group memberships into an array, and then a workflow scratchpad (Script below).  The second script documents the output into the description field of the RITM so that I can check manually to see what groups are being captured once the request is submitted in the catalog.  As you can see in above failure note, there are 12 groups that should have been applied.  So I'm capturing the data I want, just not able to apply or format it correctly in the OOTB AD activity.

Here is the script I'm using to build the array:

 

//Query for AD Role
var title = current.variables.u_title.sys_id;
var ADrole = "";

var grTitle = new GlideRecord('u_working_title');
grTitle.addQuery('sys_id',title);
grTitle.query();
if(grTitle.next()){
	ADrole = grTitle.u_active_directory_role;
}

//Declare array for groups
var group = [];

//Get AD group(s) and add to above array
var adGroup = new GlideRecord('u_m2m_active_direc_active_direc');
adGroup.addQuery('u_active_directory_roles',ADrole);
adGroup.query();
while (adGroup.next()){
	group.push(adGroup.u_active_directory_group.u_name.toString());
}
gs.log(group);
workflow.scratchpad.group = group;

And here is the "Add User to Group" activity:

find_real_file.png

Also, I don't believe the mid-server or domain controller are the issue. I'm able to successfully utilize other AD activities (AD Query, AD update, etc.). I've also verified the admin account has the necessary access to add groups by manually authenticating into AD and adding groups, etc..

Any ideas on what I'm doing wrong above?  I've checked product documentation and other community posts.  I see other folks are using custom power-shell activities, but I'd like to use this OOTB activity pack if possible.

Thanks,

Patrick

5 REPLIES 5