AZ DevOps CLI - Add Team Administrator
# Adding a Team Administrator | |
# credits: David https://stackoverflow.com/questions/59829312/how-to-add-team-administrator-using-azure-cli/60062489 | |
$myOrg = "https://dev.azure.com/<<your org>>/" | |
$newTeam = "Test Team" | |
$newAdmin = "<<user email>>" | |
$myProject = "Boards Demo" | |
echo $env:PAT | az devops login --organization $myOrg | |
# improve with team list | |
$team = az devops team create --name $newTeam --org $myOrg --project $myProject | ConvertFrom-Json | |
$user = az devops user show --user $newAdmin --organization $myOrg | ConvertFrom-Json | |
az devops security group membership add --group-id $team.identity.subjectDescriptor --member-id $user.user.descriptor --org $myOrg | |
az devops security permission update --id "5a27515b-ccd7-42c9-84f1-54c998f03866" --subject $user.user.principalName --token "$($team.projectId)\$($team.id)" --allow-bit 31 --org $myOrg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment