Passing Variables from Workflow into Powershell Script

So we have a workflow that we set up to stop the helpdesk from adding users to a group who are members of another group.  The users cannot be in both groups at the same time, these are 365 licensing groups.

What we are trying to accomplish is having a powershell script run that will remove the user they are trying to add to the group, from the other group (that they shouldnt be in).

The powershell script is simple enough, but I cannot find really any good documentation on how to pass a variable from the workflow into the script.  The variable would be the user the heldpesk is trying to add to the group, that needs to get passed to the script so the script can remove that user from the other group which they shouldn't be in.  Can anyone assist?  Thank you.

Parents
  • Have you considered an entirely different approach?

    What I have done with some success is used dynamic groups populated using Active Roles virtual attributes.

    Here's an example...

    I want to give a user only an E3 license OR an E5 license

    First group:  E3_License_Group
    Second group E5_License_Group

    Don't allow the Help Desk to directly manage the membership of either group.

    Make the groups dynamic as follows:

    Membership Rule for E3 group:


    License_Granted = E3

    Membership Rule for E5 group:

    License_Granted = E5

    Add the License_Granted virtual attribute to your web interface and add a PVG rule to your provisioning policy that allows only E3, or E5 or None as acceptable values.

    Your "audit trail" for the licensing will be the change to the contents of the virtual attribute.

  • In my suggestion above, I forgot to explicitly mention that you should create a stored, boolean virtual attribute "License_Granted" (or whatever other name makes sense to you).

Reply Children
No Data