For something that should be very straight forward, this has had me tearing my hair out for hours now...
We're currently running version 2.0.3 of the Active Directory Plugin.
I found the included workflow "Add Groups to group members".
Upon opening it, I found the following line;
userGroup.addElements(groups);
Easy as pie I thought. Takes an AD:UserGroup Object, along with an array of AD:UserGroup objects.
So, all I need to do is create a scriptable task that takes in a string and retrieves the associated Active Directory Object...
// SourceGroup is the included group
var srcgrp = ActiveDirectory.search("UserGroup",sourceGroup);
// Target Group (The one we're going to add the groups too)
var taggrp = ActiveDirectory.search("UserGroup",targetGroup);
But here's where the wheels come off...
The search method appears to return an array of "AD_UserGroup" type objects.
For the life of me, I CAN NOT figure out how to convert AD_UserGroup objects into the AD:UserGroup objects that the "Add Groups to group members" workflow requires.
Any help or advice on this would be hugely appreciated!