Can I add multiple users to a group in one rest call?

新規投稿

コメント

1件のコメント

  • 正式なコメント
    Alex Novotny

    Hi Jun! 

    Today, we only allow for adding one user at a time. You can absolutely do this in a for loop though similar to the below example I just typed out. It is a simple powershell scripts using our CLI. Also, feel free to request this feature on Pulse

    ###

    ### This script assumes you have the CLI installed and configured on your machine.

    ###

    ###This command creates a csv of all users in your box env. You could also manually make this.

    ###run box users --csv >> boxusers.csv in this file's directory ###

    ###

    $UserInput = Import-Csv -path ".\boxusers.csv"

    $GroupID = 5132113211

    ForEach ($User in $UserInput) {

    Write-Host " Adding User ID: $($User."id") to group."

    Invoke-Expression "box groups:memberships:add $($User."id") $GroupID --json" | ConvertFrom-Json

    }

    You could also copy user email addresses into the add members window in the admin console.

    Thanks, 

    Alex, Box Developer Advocate

    コメントアクション パーマリンク

サインインしてコメントを残してください。