Workflow Soluiton

 View Only
  • 1.  Active Directory Management: Showing the groups in an CheckBoxList where a User is not member of, to add him to one or more groups

    Posted Sep 12, 2014 04:46 AM

    Hello

    I am trying to build a Workflow where I can manage the Active Directory. At first I am choosing a User-Account. That I want to add to different groups. I have a list which I import from the Active Directory, but this list I want to manage becomes the User Account is already in one or more groups. I am trying to create a loop where I can filter the groups where the user is member of and only let me display the groups where I can add him. But my loop is not working. I import in an array all groups. Then I have another one where I have the Groups where the User is member of. With the loop I want to find which groups are the same in the two arrays and let write the other ones in a new array which I get displayed.

    Does someone have a best practice for that or any experiences with something like that?

     

    Greets



  • 2.  RE: Active Directory Management: Showing the groups in an CheckBoxList where a User is not member of, to add him to one or more groups
    Best Answer

    Posted Sep 12, 2014 01:20 PM
      |   view attached

    The Active Directory components "Get Group List" and "Get Groups For User" both output the same data type, so it's easy to evaluate the difference (or similarities, in this case).  Just use the component to Get Group List called "FoundGroups", then make a copy called "ResultGroups", then Get Groups For User called "UserGroups", then filter the UserGroups out of the ResultGroups, leaving the difference as the ResultGroups.  Screenshots below, test project attached.  Fill in your AD info in the project properties, and the User sAMAccountName in the Get Groups For User component.

    2014-09-12_10-40-40_0_1.png

    2014-09-12_10-39-39_0.png

    Attachment(s)

    package
    GroupsTestWebForm.package   1.50 MB 1 version


  • 3.  RE: Active Directory Management: Showing the groups in an CheckBoxList where a User is not member of, to add him to one or more groups

    Posted Sep 17, 2014 05:28 AM

    Hello Andrew!

    Thank you for your quick answer. Great work, it work how i was imagining it.

     

    I just have another question to this topic. I know how I can add a single User to a single Organizational Group in the Active Directory. But is it possible to select from the difference more then one group, for example with a CheckBoxList, and then add the User to all the selected Groups?

     

    Greets Turl



  • 4.  RE: Active Directory Management: Showing the groups in an CheckBoxList where a User is not member of, to add him to one or more groups

    Posted Sep 17, 2014 10:15 AM
      |   view attached

    you can use a checkbox list, or you can use a ListBox (which i personally like better) and set the ListBox component to use multiple selection.  in the example I attached in my original reply, the component List Items was used to demonstrate the data configuration.  just swap it out for a ListBox instead; the configuration is very similar.  then loop through the selected groups and add the user to each one.  I've attached an updated model.

    -andrew

    Attachment(s)

    package
    GroupsTestWebForm2.package   1.54 MB 1 version