locked
Add multiple Users in a Group RRS feed

  • Question

  • Hi guys,

    i need to add multiple users in a specific group.

    I tried to creata a runbook with two parameters (Users,Group). It's very simple, but i see that is it possible to run an instance and insert only user.

    The question is: if i must to add multiple users, for example us1,us2,u3, how can do it?

    many thanks

    a.

    Wednesday, May 25, 2016 2:21 PM

Answers

  • This is no problem and simple to resolve.

    When you have a series of data that you want to individually process the elements within, I found the best method is to transpose the data set onto the databus so that Orchestrator will process each element individually.

    To do this I use the Run .Net Script activity and add the following bit of code as an example:

    $dataSet = "June,John,Jane,Jenn,Jason"
    $users =  @()
    $tokens = $dataSet -Split ","
    foreach( $token in $tokens )
    {
      $users += $token.Trim()
    }

    Just replace $dataSet with published data and publish the variable users as return data. Note you want the Trim() call to remove any unwanted white spaces.  

    Now you can process a group of users or just one user for your runbook.

    Thursday, May 26, 2016 12:37 PM

All replies

  • Hi,

    Could you post a screenshot? This will help us understand that you've done so far.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, May 26, 2016 9:44 AM
  • This is no problem and simple to resolve.

    When you have a series of data that you want to individually process the elements within, I found the best method is to transpose the data set onto the databus so that Orchestrator will process each element individually.

    To do this I use the Run .Net Script activity and add the following bit of code as an example:

    $dataSet = "June,John,Jane,Jenn,Jason"
    $users =  @()
    $tokens = $dataSet -Split ","
    foreach( $token in $tokens )
    {
      $users += $token.Trim()
    }

    Just replace $dataSet with published data and publish the variable users as return data. Note you want the Trim() call to remove any unwanted white spaces.  

    Now you can process a group of users or just one user for your runbook.

    Thursday, May 26, 2016 12:37 PM