add multiple users to group with variable

Kennyties
Kennyties
Community Member

Hello all,

I was wondering if it is possible to add multiple users to a group using a variable in PowerShell. What information Could I also get more detailed instructions on how to add a user to a group?
I see in the documentation that the format should follow the below:
""op add user <user> [<vault> | <group>]""

When I try to use:
""op add user $variablehere group name here""
I get an invalid request.

Comments

  • ag_yaron
    ag_yaron
    1Password Alumni

    Hey @Kennyties ,

    There's no way that I know of to add multiple users with a single command.
    Perhaps you can do that with a loop in your script that will run the op add command for as many users you have in an array :)

  • Kennyties
    Kennyties
    Community Member

    Hey @ag_yaron,

    Thanks for the update. As I thought about this more, I figure I can use a foreach loop to loop through a list of individuals and that should work.

  • ag_yaron
    ag_yaron
    1Password Alumni

    Yep, definitely the right direction :+1:

  • Kennyties
    Kennyties
    Community Member

    Thanks!

  • ag_ana
    ag_ana
    1Password Alumni

    :+1: :)

This discussion has been closed.