This script list all users on Azure DevOps organization and which groups they belong to
Press enter or click to view image in full size
An original script is available on my GitHub repository. See bellow this script:
Let’s go understand each used command.
PowerShell script will receive the following parameters:
$PAT = Personal Access token to connect on Azure DevOps;
$Organization = Organization URL to list all users and permissions.
2. az devops user list = use this command to list all users on Azure DevOps organization.
az devops user list [--detect {false, true}] [--org] [--skip] [--top]$allUsers = az devops user list --org $Organization | ConvertFrom-Jsonforeach($au in $allUsers.members) { Write-Host $au.user.principalName }
az devops security group membership list --id [--detect {false, true}] [--org] [--relationship {memberof, members}]$activeUserGroups = az devops security group membership list --id $au.user.principalName --org $Organization --relationship memberof | ConvertFrom-Json
4. After executing the script on PowerShell, will be generated a JSON file that lists all users and your respective groups.
5. After creating JSON, I connected it on Power BI, as shown bellow:
Press enter or click to view image in full size
Groups Filter (1): filter a respective group to list users;