How can I fetch all default user fields from Microsoft Graph API along with accountEnabled?

Vaishali Ranjan 20 Reputation points
2025-05-16T06:42:49.4666667+00:00

I'm using the Microsoft Graph API endpoint https://graph.microsoft.com/v1.0/users to fetch users from Entra ID (Azure AD). By default, it returns a limited set of user fields. I want to add the accountEnabled field to this response without losing any of the default fields.

I know that using the $select query parameter overrides the default fields, so I need to specify all the fields manually. But I want to avoid hardcoding all default fields if possible.

Is there a way to include accountEnabled in the default response without listing all default fields explicitly in $select? Or is manually listing all fields (including the default ones) the only option?

Any official documentation or workaround would be helpful.

Thanks in advance!

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
25,019 questions
{count} votes

Accepted answer
  1. Bandela Siri Chandana 3,055 Reputation points Microsoft External Staff Moderator
    2025-05-16T08:17:41.14+00:00

    Hi @Vaishali Ranjan
    It seems like you're trying to fetch user details from the Microsoft Graph API and want to include the accountEnabled field without losing any of the default fields. Unfortunately, when you use the $select query parameter, it does require you to specify all the fields you want to include, which means you would indeed have to list the default fields manually along with accountEnabled.

    There isn’t a built-in method to automatically add a field, like accountEnabled, to the default response fields without specifying all the fields you want to receive.

    Here's a concise way to include the accountEnabled field with the Graph API:

    GET https://graph.microsoft.com/v1.0/users?$select=id,businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName,accountEnabled
    
    

    If you have a lot of fields you want to request, consider using a library or utility that can fetch the default fields first and then append accountEnabled dynamically.

    For your reference, here’s the documentation that covers this main topic:

    Working with users in Microsoft Graph
    Hope this helps. Do let us know if you have any further queries.
    If this answers your query, do click `Accept Answer` and `Yes`.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Tai Tran 0 Reputation points Independent Advisor
    2025-05-16T09:34:21.0233333+00:00

    Hi @Vaishali Ranjan,

    Thank you for contacting Q&A Forum. I would like to provide my findings and proposed solution:

    Unfortunately you cannot include accountEnabled (or any non-default field) in the default response without explicitly listing all fields using the $select parameter because: 

    The Microsoft Graph API only returns a default subset of user properties when you call /users without $select

    Once you use $select, it overrides the default set—so you must manually list every field you want, including the default ones 

    If you want to include accountEnabled along with the default fields, you must: 

    1. Manually list all default fields (like id, displayName, userPrincipalName, etc.) 
    2. Add accountEnabled to that list. 

    For example:

    GET https://graph.microsoft.com/v1.0/users?$select=id,businessPhones,displayName,givenName,jobTitle,....,accountEnabled
    
    
    

    If you want more details, please visit: 

    javascript - Get all user properties from Microsoft graph - Stack Overflow 

    Get user - Microsoft Graph v1.0 | Microsoft Learn 

    Kindly let me know if this work for you and please let me know if you have any further question.

    Best regards,

    0 comments No comments

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.