Jorge
Jorge

Reputation: 2196

Get user assignments to Azure AVD application group with python sdk

I'm trying to get the assignments of an AVD application group, but I do not see any way to do it in the python azure sdk:

https://learn.microsoft.com/en-us/python/api/azure-mgmt-desktopvirtualization/azure.mgmt.desktopvirtualization.models.applicationgroup?view=azure-python

Is there any other way using python to get which users are assigned to that application group?

Upvotes: 0

Views: 144

Answers (1)

Venkat V
Venkat V

Reputation: 7820

Get user assignments to Azure AVD application group with python sdk. Is there any other way to get which users are assigned to that application group?

Alternatively, you can also fetch the users who are assigned to the application group in AVD.

    $APGroupname = Get-AzWvdApplicationGroup -ResourceGroupName "RG_Name" -Name "application_group_name"
    $appGroupName | ForEach-Object {
        $name = $_.Name
        $AVDassign = Get-AzRoleAssignment | Where-Object { $_.Scope -like "*/$name" }
        $assignment | Select-Object DisplayName, ObjectType, @{N = 'ActionGroup'; E = { $_.Scope.Split('/')[-1] } }
    }

After running the PowerShell script, the users assigned to the application group are displayed.

Output:

enter image description here

Reference: Azure Virtual Desktop get list of users/groups assigned to Application Group with PowerShell

Upvotes: 0

Related Questions