add multiple users to group with variable

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_yaronag_yaron

    Team Member

    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 :)

  • 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_yaronag_yaron

    Team Member

    Yep, definitely the right direction :+1:

  • Thanks!

  • ag_anaag_ana

    Team Member

    :+1::)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file