How do I retrieve the owners of a Distribution List using Microsoft Graph?

I am unsure if I found a bug, or if I am using this the wrong way: I am unable to retrieve the owners of a DL group using Graph.

Steps:

  1. Let's assume my email is [email protected]. I created a Distribution List group in the Microsoft 365 Admin Center of my Exchange server, and set myself (the admin) as the owner of that DL. I named this DL "TestDG1". I also added this same user as the sole member of the DL.

  2. I then visited the Graph Explorer website, logged in as the admin, gave myself Read permissions to access groups, contacts, users, and executed this query:

https://graph.microsoft.com/v1.0/groups/?$filter=startswith(displayName,'TestDG')

I got a successful response with this information:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
    "value": [
        {
            "id": "01234567-89AB-CDEF-0123-456789ABCDEF",
            "deletedDateTime": null,
            "classification": null,
            "createdDateTime": "2018-10-15T18:38:08Z",
            "creationOptions": [],
            "description": null,
            "displayName": "TestDG1",
            "groupTypes": [],
            "mail": "[email protected]",
            "mailEnabled": true,
            "mailNickname": "TestDG1",
            "onPremisesLastSyncDateTime": null,
            "onPremisesSecurityIdentifier": null,
            "onPremisesSyncEnabled": null,
            "preferredDataLocation": null,
            "proxyAddresses": [
                "SMTP:[email protected]"
            ],
            "renewedDateTime": "2018-10-15T18:38:08Z",
            "resourceBehaviorOptions": [],
            "resourceProvisioningOptions": [],
            "securityEnabled": false,
            "visibility": null,
            "onPremisesProvisioningErrors": []
        }
    ]
}
  1. Using the ID of my group (01234567-89AB-CDEF-0123-456789ABCDEF), I checked if I could retrieve that DL's information using:

https://graph.microsoft.com/v1.0/groups/01234567-89AB-CDEF-0123-456789ABCDEF

And I got a successful response:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups/$entity",
    "id": "01234567-89AB-CDEF-0123-456789ABCDEF",
    "deletedDateTime": null,
    "classification": null,
    "createdDateTime": "2018-10-15T18:38:08Z",
    "creationOptions": [],
    "description": null,
    "displayName": "TestDG1",
    "groupTypes": [],
    "mail": "[email protected]",
    "mailEnabled": true,
    "mailNickname": "TestDG1",
    "onPremisesLastSyncDateTime": null,
    "onPremisesSecurityIdentifier": null,
    "onPremisesSyncEnabled": null,
    "preferredDataLocation": null,
    "proxyAddresses": [
        "SMTP:[email protected]"
    ],
    "renewedDateTime": "2018-10-15T18:38:08Z",
    "resourceBehaviorOptions": [],
    "resourceProvisioningOptions": [],
    "securityEnabled": false,
    "visibility": null,
    "onPremisesProvisioningErrors": []
}
  1. If I request the owners, nothing comes back. I used two methods:

A) Expanding the owners array:

https://graph.microsoft.com/v1.0/groups/01234567-89AB-CDEF-0123-456789ABCDEF/?$expand=owners

I get a successful response, but the owners array is empty:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
    "value": [
        {
            "id": "01234567-89AB-CDEF-0123-456789ABCDEF",
            "deletedDateTime": null,
            "classification": null,
            "createdDateTime": "2018-10-15T18:38:08Z",
            "creationOptions": [],
            "description": null,
            "displayName": "TestDG1",
            "groupTypes": [],
            "mail": "[email protected]",
            "mailEnabled": true,
            "mailNickname": "TestDG1",
            "onPremisesLastSyncDateTime": null,
            "onPremisesSecurityIdentifier": null,
            "onPremisesSyncEnabled": null,
            "preferredDataLocation": null,
            "proxyAddresses": [
                "SMTP:[email protected]"
            ],
            "renewedDateTime": "2018-10-15T18:38:08Z",
            "resourceBehaviorOptions": [],
            "resourceProvisioningOptions": [],
            "securityEnabled": false,
            "visibility": null,
            "onPremisesProvisioningErrors": [],
            "owners": []
        }
    ]
}

B) Querying for the DL's owners directly:

https://graph.microsoft.com/v1.0/groups/01234567-89AB-CDEF-0123-456789ABCDEF/owners

I got a successful response, but the value array is empty:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
    "value": []
}
  1. Interestingly, I can retrieve the members without problems:

https://graph.microsoft.com/v1.0/groups/01234567-89AB-CDEF-0123-456789ABCDEF/members

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
    "value": [
        {
            "@odata.type": "#microsoft.graph.user",
            "id": "00001111-2222-3333-4444-555566667777",
            "businessPhones": [],
            "displayName": "Contoso Administrator",
            "givenName": "Admin",
            "jobTitle": null,
            "mail": "[email protected]",
            "mobilePhone": null,
            "officeLocation": null,
            "preferredLanguage": "en-US",
            "surname": "Contoso",
            "userPrincipalName": "[email protected]"
        }
    ]
}

Or by expanding members:

https://graph.microsoft.com/v1.0/groups/01234567-89AB-CDEF-0123-456789ABCDEF?$expand=members

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups/$entity",
    "id": "01234567-89AB-CDEF-0123-456789ABCDEF",
    "deletedDateTime": null,
    "classification": null,
    "createdDateTime": "2018-10-15T18:38:08Z",
    "creationOptions": [],
    "description": null,
    "displayName": "TestDG1",
    "groupTypes": [],
    "mail": "[email protected]",
    "mailEnabled": true,
    "mailNickname": "TestDG1",
    "onPremisesLastSyncDateTime": null,
    "onPremisesSecurityIdentifier": null,
    "onPremisesSyncEnabled": null,
    "preferredDataLocation": null,
    "proxyAddresses": [
        "SMTP:[email protected]"
    ],
    "renewedDateTime": "2018-10-15T18:38:08Z",
    "resourceBehaviorOptions": [],
    "resourceProvisioningOptions": [],
    "securityEnabled": false,
    "visibility": null,
    "onPremisesProvisioningErrors": [],
    "members": [
        {
            "@odata.type": "#microsoft.graph.user",
            "id": "00001111-2222-3333-4444-555566667777",
            "deletedDateTime": null,
            "accountEnabled": true,
            "ageGroup": null,
            "businessPhones": [],
            "city": null,
            "companyName": null,
            "consentProvidedForMinor": null,
            "country": null,
            "createdDateTime": null,
            "department": null,
            "displayName": "Contoso Administrator",
            "givenName": "Admin",
            "jobTitle": null,
            …
            …
            … // and all its properties
        }
    ]
}

So is this a bug, or am I doing something wrong? If it's a bug, where do I report it?

Upvotes: 1

Views: 2137

Answers (1)

Philippe Signoret
Philippe Signoret

Reputation: 14336

At the moment (as 2019-04-18), owners for mail-enabled security groups and distribution lists are not currently included in owners in Microsoft Graph. Owners are currently available only for security groups (not mail-enabled), and Office 365 groups.

Upvotes: 1

Related Questions