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`
.