0

I am trying to list all the users in a devops organization using below command.

az devops user list --org https://dev.azure.com/**orgname** --query '[].{user.licenseDisplayName}' , however this doesnt provide correct output. Since this has multiple users and o/p contains array, I am not able to correctly apply the query filter.

I am trying to fetch something like below for all the users in our devops org.

PS C:\Users\v-mahammadt> az devops user show --user xxxxx@outlook.com --org https://dev.azure.com/orgname --query '[user.displayName,accessLevel.licenseDisplayName,lastAccessedDate]'
[
  "xxxxx@outlook.com",
  "Basic",
  "2021-09-03T04:53:14.890927+00:00"
]
Matt
  • 3,658
  • 3
  • 14
  • 27
Thahif
  • 5
  • 2

2 Answers2

1

We can list down all the users in our Azure DevOps Organizations by adding –query tag including all the parameters which are in json format.

To trace it down first we need to execute the below command and check the JSON structure.

az devops user list --org $orgURL

After getting the output need to check the JSON format for username

As I did a repro for this below is the command which will work to get the list of users from our Azure DevOps organization

az devops user list --org $orgURL --query members[].user.displayName -o json

My Repro screenshot as below: enter image description here

SaiKarri-MT
  • 1,174
  • 1
  • 3
  • 8
0

user list --org $orgURL --query members[].user.displayName -o json

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 25 '21 at 20:59