Add Bulk Users to a Group

Is there a way using which you can add users in bulk to a Group using:

Web Client

Fat Client

PowerShell --> Provide the cmdlet and complete syntax

Parents
  • Something like this would do the job:

    # This script is created and stored as a policy script under "Script Modules" in ARS and then

    # referenced in the workflow script activity

    function BulkAddMembers ($Request)

    {

    <#

    Assumption input file contains the following: samaccountname,targetgroup

    Example:

    samaccountname,targetgroup

    MyDom\SJones,MyDom\MyGroup1Name

    MyDom\BSmith,MyDom\MyGroup1Name

    MyDom\MHoward,MyDom\MyGroup2Name

     

    #>

    # 'Input file' is the actual name of the parameter of the workflow that prompts the user for the file

    # This name could be anything but is handy because it serves as a prompt as well

    $InputFile = $workflow.parameter("input file")

    Import-Csv $InputFile | %{

    Add-QADGroupMember -Identity $_.TargetGroup -Member $_.samaccountname

    }

    }

Reply
  • Something like this would do the job:

    # This script is created and stored as a policy script under "Script Modules" in ARS and then

    # referenced in the workflow script activity

    function BulkAddMembers ($Request)

    {

    <#

    Assumption input file contains the following: samaccountname,targetgroup

    Example:

    samaccountname,targetgroup

    MyDom\SJones,MyDom\MyGroup1Name

    MyDom\BSmith,MyDom\MyGroup1Name

    MyDom\MHoward,MyDom\MyGroup2Name

     

    #>

    # 'Input file' is the actual name of the parameter of the workflow that prompts the user for the file

    # This name could be anything but is handy because it serves as a prompt as well

    $InputFile = $workflow.parameter("input file")

    Import-Csv $InputFile | %{

    Add-QADGroupMember -Identity $_.TargetGroup -Member $_.samaccountname

    }

    }

Children
  • Johnny,

    Sorry for bringing up an old thread but was curious about this statement:

    2) Setup a parameter in the workflow that prompts the user for the input file name.  To support this, I will usually create a two line script that enumerates files in a particular folder to present to the user a list of input files to select from.

     

    I would like to see if you can elaborate on this as I am having difficulties getting anything to be presented in the web interface using workflow parameters or workflow scripts , like a folder or file share that will list files.

    I am assuming by 2 line script to enumerate you mentioned, would be something similar to this:

    function getfiles {
    $values = Get-ChildItem -path "\\devserver.mycompany.com\Temp" | Select Name
    return $values
    }

     

    but how does AR give the end users web interface a dialog / modal box to select the file they want.?

    I am ultimately trying not to have to teach large numbers of people how to use the quest commandlets

     

    Any direction/guidance on how to get bulk add users to a group through the WI would be great.