How to: Include new users based on active user permissions on Azure DevOps using Azure DevOps CLI

This script will include new user on Azure DevOps based on the current permissions of an active user

Every time we hire new IT people for the team and we need to add this user on Azure DevOps, we usually rely on the profile of an existing user. If you don’t use AAD to associate these permissions, the script below is very useful to you:

An original script is available on my GitHub repository. Let’s go understand each used command.

2. az devops user add = use this command to insert users on Azure DevOps.

az devops user add — email-id
— license-type {advanced, earlyAdopter, express, professional, stakeholder}
[ — detect {false, true}]
[ — org]
[ — send-email-invite {false, true}]

3. az devops security group membership list = use this command to list all groups that based user is contained in.

az devops security group membership list --id
[--detect {false, true}]
[--org]
[--relationship {memberof, members}]

4. az devops security group membership add = use this command to insert a new user on user groups.

az devops security group membership add --group-id
--member-id
[--detect {false, true}]
[--org]

After executing the script, the new user will have the same permissions as the user used as an example.

--

--

Tech Solution Architect Manager na Accenture

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store