Number of employees for a tenant

Gambhir Kunwar 25 Reputation points Microsoft Employee
2023-05-22T22:29:53.6+00:00

Context: Our team is working on provisioning for a product. We need to make Graph calls.

Our team needs to get a number of employees for a tenant provisioning. We're using GET /users/$count endpoint using a bearer token. We tested with Microsoft and got more employees (like ~over 1 million). Is this correct? Is MS Graph counting all the employees since the company established? According to Linkedln as of today, it shows 231,237 employees for Microsoft (publicly available on Linkedln)

Questions: Is there a way to get count of just the active employees in MS Graph?

Or if thats not an option, could we use #seats i.e license count from the subscribed skus endpoint GET /subscribedSkus?

Thanks!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,540 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-05-29T06:32:44.2966667+00:00

    Hello Gambhir Kunwar,

    Thanks for reaching out!

    Yes, you can retrieve the count of active employees in Microsoft Graph by using the /$count endpoint with a specific filter. The /users/$count endpoint without any filter will return the total count of all users in the tenant, including both active and inactive users.

    To get the count of active employees, you can apply a filter based on the user's account status. You can use the accountEnabled property to filter out the inactive users. The request would look something like this:

    GET /users/$count?$filter=accountEnabled eq true
    

    This will return the count of active employees in your tenant.

    Regarding your second question, using the license count from the /subscribedSkus endpoint is not the recommended approach for getting the count of active employees. The subscribedSkus endpoint provides information about the licenses assigned to users, but it does not directly indicate the active user count. It's possible for users to have assigned licenses without being active users in the system.

    Using the /users/$count endpoint with the appropriate filter is the recommended way to get the count of active employees in Microsoft Graph.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.