question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request]Add/Remove User to/from Team

See original GitHub issue

Is your feature request related to a problem? Please describe. We frequently get asked to add/remove users from teams. Currently I’ve got a Powershell command which is just a wrapper around the REST API.

Please forgive me if I’ve missed something in the documentation, but I can’t see a way to do this currently with the az devops cli.

I’d love to jump in and contribute to this project, I’d just like confirmation that this is a valid Feature Request/a good idea.

Describe the solution you’d like Something like this?

az devops team add-member --team --user (The name or id of the user to add)
az devops team remove-member --team --user (The name or id of the user to add)

EDIT: Having read #319 I guess this should be

az devops team member add
az devops team member remove

And list-member should then be az devops member list

as originally proposed

Additional context I’d also like to be able to pipe the output of az devops user show --user to the command

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jogleasonjrcommented, May 6, 2019

[You can get group descriptor for ‘MYPROJECT TEAM’ by using jmespath query along with this command]

Took me a few to figure out how to use this in a bash script by setting a variable. Here’s an example:

groupDescriptor="$(az devops security group list --project MYPROJECT --output json --query "graphGroups[?displayName == 'MYPROJECT Team'].descriptor | [0]" -o tsv)"

Then echo $groupDescriptor or use it elsewhere in your script. It contains the descriptor e.g. vssgp.Uy0xLTXXXXXXXXXXXXXX.... To add a user to the project’s group:

az devops security group membership add --group-id  $groupDescriptor --member-id <EMAIL_ID>

These commands, running from the Azure CLI pipeline task at least, had trouble figuring out if I was logged in or not, and to fix it I had to specify the --org parameter.

1reaction
ishitam8commented, Apr 17, 2019

HI @teejam2 ,

This is not yet released, but the functionality would be coming up in next release (i.e version 0.5.0) Every team would be considered as a group as well , and you can manage teams the same way you manage groups . Please find the details of command structure in this issue #471

Add/remove member functionality is supported as a part of group management commands where you can create/update/list and delete groups as well.

Currently, you can list members for the team anyway with this command az devops team list-member --team <team_name>/<team_ID> But for rest of the operations you will have to use Group related commands.

Check az devops team list-member --help for more details.

What do you mean by following? I’d also like to be able to pipe the output of az devops user show --user to the command Could you please tell me what is the scenario you are trying to solve here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature Request: Action - Remove User from Google Group
Looking at our records, I can see we have an open feature request for the functionality you're after - Delete/remove Member from Group...
Read more >
Remove users from Azure DevOps - Microsoft Learn
Steps for how to delete or remove organization users from Azure DevOps and remove users from a team or project.
Read more >
Add/Remove Users - PerformFlow - PerformFlow
To add users, simply enter your member's email address at “Add team member” section and click Add. Then the added email address will...
Read more >
Add or remove multiple users from the group - ServiceNow
Requirement is manager of a particular group should be able to add multiple users to the selected group or remove multiple users from...
Read more >
Add or remove people from your team-managed service project
You can only add people who have joined your Atlassian site. If you can't find someone by their name or email address, ask...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found