简体   繁体   中英

Accessing Azure Active directory users and roles

As Azure REST APIs helps to retrieve the users and corresponding roles information at subscription level.

I would like to know that I have manually created a few users and assigned them different roles in Azure Active directory and i want to access those information from azure active directory through REST API calls or in a programmatic way.

How can I access that information at azure active directory level to retrieve the user list ? is there any API calls available ? what about GRAPH API on this scenario and how it can be used ?

Please input your suggestions. Thanks All !

Yes, you can do this via the REST API.

There are two APIs available:

  1. Azure Active Directory Graph API - graph.windows.net (old)
  2. Microsoft Graph graph.microsoft.com (new).

You should go with the new graph.microsoft.com API (check whether the new API covers all your requirements).

See Working with users in Microsoft Graph

You can use Microsoft Graph to list all users: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list

https://graph.microsoft.com/v1.0/users/

You can give it a try with the Graph Explorer at https://developer.microsoft.com/en-us/graph/graph-explorer

You will need an access token to call Microsoft Graph, more information about obtaining an access token can be found here: https://developer.microsoft.com/en-us/graph/docs/concepts/auth_overview

You could use the Azure AD Graph API to retrieve users list and corresponding roles by using GET https://graph.windows.net/myorganization/users?api-version=1.6 . For the details, please read here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM