Nestor Fedyk
Nestor Fedyk

Reputation: 188

Microsoft Graph API - Can't fetch group members of contact type

I have a group that contains group, user and contact as members. I can fetch all of them in Admin UI and via PowerShell command Get-DistributionGroup -Identity 'myGroup'. Result looks like

[{
        "Alias": "xxxxxx",
        "Guid": "xxxxxx",
        "Identity": "xxxxx",
        "PrimarySmtpAddress": "xxxxxx",
        "RecipientType": "UserMailbox",
        "SamAccountName": "xxxxxxx",
        "WindowsLiveID": "xxxxxxx"
    },
    {
        "Alias": "yyyyyyyyy",
        "Guid": "yyyyyyyyy",
        "Identity": "yyyyyyyyy",
        "PrimarySmtpAddress": "yyyyyyyyy",
        "RecipientType": "MailUniversalSecurityGroup",
        "SamAccountName": "yyyyyyyyy",
        "WindowsLiveID": ""
    },
    {
        "Alias": "zzzzzzzzzz",
        "Guid": "zzzzzzzzzz",
        "Identity": "zzzzzzzzzz",
        "PrimarySmtpAddress": "zzzzzzzzzz",
        "RecipientType": "MailContact",
        "SamAccountName": "",
        "WindowsLiveID": ""
    }
]

Documentation states that GET /groups/{id}/members should return all group members, including users, contacts, and other groups as members.

I get only user and group tyro members back, not mail contact is returned.

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
    "value": [{
            "@odata.type": "#microsoft.graph.user",
            "id": "xxxxxx",
            ........
        },
        {
            "@odata.type": "#microsoft.graph.group",
            "id": "yyyyyyyyy",
            ........
        }
    ]
}

Is this a bug in API or documentation?

Upvotes: 2

Views: 477

Answers (1)

Marc LaFleur
Marc LaFleur

Reputation: 33094

Currently, the /v1.0 endpoint does not support Contacts. Since it isn't aware of Contacts, it isn't capable of returning them via /members.

The /beta endpoint has support for the microsoft.graph.orgContact entity. If you switch to this version, you should start seeing Contact members showing up in the results.

This is documented in the Known Issues but it's a little hidden. It isn't filed under Groups but instead under Contacts: Organization contacts available in only beta.

Upvotes: 1

Related Questions