Use GraphApi to search using an AzureAD SID - SecurityIdentifier?

Phil Crombie 0 Reputation points
2023-02-06T10:09:16.2033333+00:00

Noob user here. Im struggling to search AzureAD using GraphAPI to find a group name using its SecurityIDentifier.
I can return group names and sid values using
https://graph.microsoft.com/v1.0/groups?$select=displayName,securityIdentifier
But due to the number of groups and pagination, i cant subsequently just use find for the sid/group name.
Is there a way to use filter of something to enter the SID value to return one value ?
Thanks in advance

:)

Microsoft Security Microsoft Entra Microsoft Entra ID
Microsoft Security Microsoft Graph
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2023-02-06T10:28:24.3366667+00:00

    Sure, you can use the $filter operator. Here's an example for a given SID:

    GET https://graph.microsoft.com/v1.0/groups?$filter=securityIdentifier eq 'S-1-12-1-143658405-1084415652-4082819753-371914418'

    Keep in mind that not every property is filterable though. And some of them require "advanced" filters, as detailed here.

    Oh and if you want to return only a single property and not the full object, use something like this:

    GET https://graph.microsoft.com/v1.0/groups?$filter=securityIdentifier eq 'S-1-12-1-143658405-1084415652-4082819753-371914418'&$select=displayName

    1 person found this answer helpful.

  2. Shweta Mathur 30,296 Reputation points Microsoft Employee Moderator
    2023-02-13T08:34:29.11+00:00

    Hi @Phil Crombie ,

    Thanks for reaching out.

    I understand you are trying filter securityidentfier from large number of groups using Graph API.

    As @Vasil Michev mentioned, you can easily filter using security identifier as below which will provide result based on filter.

    User's image

    If you still have query regarding this. please let us know to help you further.

    Thanks,

    Shweta

    Please remember to "Accept Answer" if answer helped you.

    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.