Search code examples
c#active-directorymicrosoft-graph-api

Get extensionAttribute1 - extensionAttribute15 of a GROUP using the Microsoft Graph API?


It is easy enough to get the extensionAttributes of a user by selecting "onPremisesExtensionAttributes", but when I do the same for a group I do not see that collection. Is there a permission I do not have (I have Group.Read.All) or a different way to get this information?

Microsoft's documentation says they are synced but I'm not sure if that is an indicator that they are available to get using the graph API.

https://learn.microsoft.com/en-us/azure/active-directory/hybrid/reference-connect-sync-attributes-synchronized

Users example:

            var usersPage = graphClient
            .Users
            .Request()
            .Select("onPremisesExtensionAttributes")
            .GetAsync()
            .Result;

Solution

  • As mentioned in the document the Extension are attributes is only supported to User and Device only.

    enter image description here

    For more information:https://learn.microsoft.com/en-us/graph/extensibility-overview?tabs=http#comparison-of-extension-types

    Hope this helps.