Add user to AD group and run script

We have 19 groups, say if user is added to 3 groups out of those 19. the WF should add that single user to another security group and execute the script or assign 0365 License.

can someone guide me a good approach to achieve this?

Parents
  • Are you looking for this to happen if they are added to ANY 3 of the 19?

  • If all you want to do is have Active Roles react to the addition of a member to one of your 19 groups, I would proceed as follows:

    1) Create a Change Workflow for the object class group and the "Add Member" action.

    2) At the very bottom of the filtering conditions dialog, you can add a condition that looks at the target object name - this is where you can add an "OR" entry for each of your 19 groups.  So: Target object name is Group 1 OR Target object name is Group 2 OR Target object name is Group 3 ...and so on,

    Give this a try and please post additional questions should you run into problems.


  • Sorry... didn't finish my thought above.

    Once you have the filtering condition setup, you can add a script activity to your workflow.

    Basically, you take the Powershell code that you want to run when the group membership change happens and enclose it in a function.  The function can be called anything you want.  You will need at least one parameter for your function and that is "$Request".  $Request is the object that contains that current Active Roles transaction.  There was fairly recently a thread here that talked about dealing with group membership transactions.  I posted some code in that discussion.  Suggest you have a look at this.

Reply
  • Sorry... didn't finish my thought above.

    Once you have the filtering condition setup, you can add a script activity to your workflow.

    Basically, you take the Powershell code that you want to run when the group membership change happens and enclose it in a function.  The function can be called anything you want.  You will need at least one parameter for your function and that is "$Request".  $Request is the object that contains that current Active Roles transaction.  There was fairly recently a thread here that talked about dealing with group membership transactions.  I posted some code in that discussion.  Suggest you have a look at this.

Children
No Data