0
votes

I want to retrieve all the user information from Subscription. We can get all the user list from an Azure subscription using below article.

https://docs.microsoft.com/en-us/rest/api/authorization/roleassignments/list

But above URl retrieves list of all User GUIDs(and some more information) but here i want user display name, mailid, etc.

Please help me How can i do this.

We can send this user GUIDs to graph API to retrieve the User information but it needs consent from Tenant admin and also we need two more extra calls(one is to get Graph bearer access token and other is call to graph api with above list of User GUIDs). So how can i do this with out graph API.

2

2 Answers

1
votes

I don't think there is any option available for retrieving the user details.

The only option is to use Graph API with the token generated by an application(Service Principal) or Active Directory User.

The User or the Principal should have Read Active Directory Users permission to fetch the user details.

1
votes

You could utilise the RBAC Graph part of the Resource Manager API. If you're returning a list of GUID's you could loop through them calling

GET https://graph.windows.net/{tenantID}/users/{upnOrObjectId}?api-version=1.6

Which will return to you a better representation of the user