Jingqiang Zhang
Jingqiang Zhang

Reputation: 1049

Is it possible to get all the user informations in a tenant by Azure AD Graph API or Microsoft Graph API?

From the Azure Active Directory v2.0 authentication libraries we can see lots of samples about how to use libraries to connect Active Directory. It seems all of them should create an application at apps.dev.microsoft.com first. Then use the Application ID and a new password to act the clientID and clientSecret in a client or server middleware application.

This way, one user can use the application to login by oauth 2 or openid through the Azure Active Directory API. Also can get the personal information such as user profile correctly.

But, if I want to get all the users information in a tenant one time, is there an API can do?

Upvotes: 1

Views: 3354

Answers (1)

Rohit Saigal
Rohit Saigal

Reputation: 9674

But, if I want to get all the users information in a tenant one time, is there an API can do?

You can use Microsoft Graph API - specifically List Users API.

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

For a quick test, try using Microsoft Graph Explorer


Similarly you can list users with Azure AD Graph API as well, but it would be recommended to use Microsoft Graph API.

Read Microsoft Graph or Azure AD Graph and this SO Post (Only case to use Azure AD Graph API would be if you need something very specific that you aren't able to achieve with stable version of the newer Microsoft Graph API.)

Azure AD Graph API to list users (not recommended)

https://graph.windows.net/myorganization/users

Upvotes: 3

Related Questions