I have already spent several hours trying to figure out how to get a list of members of a user group in active directory.
My first approach was something like this one:
for (i in userGroup.userMembers) {
System.log(userGroup.userMembers[i].accountName);
}
with:
userGroup as AD:UserGroup
and, according to the API help, userGroup.userMembers being an array of AD_User.
Please be aware of the ”_” in the AD_User scripting class.
But the for loop comes up with exactly nothing, the attribute “userMembers” does not exist.
I believe that this is because the AD:UserGroup is a type, which does not offer the same attributes and methods as the class AD_UserGroup.
I also tried to put or map the AD:UserGroup into AD_UserGroup but vCO fails to create such an object:
var myAD_UserGroup = new AD_UserGroup() ;
ends up with:
Unable to create object : AD_UserGroup : ch.dunes.ad.object.UserGroup
Any ideas?