@Mohamed Jbeli You can use the Get-AzManagementGroup
command in Azure PowerShell to retrieve all management groups. To retrieve information for a single management group, you can use the -GroupId
parameter. To return a specific management group and all the levels of the hierarchy under it, you can use the -Expand
and -Recurse
parameters.
You can also use the list
command in Azure CLI to retrieve all management groups. To retrieve information for a single management group, you can use the show
command. To return a specific management group and all the levels of the hierarchy under it, you can use the -e
and -r
parameters.
You can also use the REST API to retrieve information about management groups. The target scope for management groups in the REST API is "/providers/Microsoft.Management/managementGroups/{yourMgID}".
For more information, you can refer to the following links: https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/governance/management-groups/manage.md
If the response helped, do "Accept Answer" and up-vote it