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:
Let's assume my email is admin@contoso.com. 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.
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": "testdg1@contoso.com",
"mailEnabled": true,
"mailNickname": "TestDG1",
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": [
"SMTP:testdg1@contoso.com"
],
"renewedDateTime": "2018-10-15T18:38:08Z",
"resourceBehaviorOptions": [],
"resourceProvisioningOptions": [],
"securityEnabled": false,
"visibility": null,
"onPremisesProvisioningErrors": []
}
]
}
- 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": "testdg1@contoso.com",
"mailEnabled": true,
"mailNickname": "TestDG1",
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": [
"SMTP:testdg1@contoso.com"
],
"renewedDateTime": "2018-10-15T18:38:08Z",
"resourceBehaviorOptions": [],
"resourceProvisioningOptions": [],
"securityEnabled": false,
"visibility": null,
"onPremisesProvisioningErrors": []
}
- 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": "testdg1@contoso.com",
"mailEnabled": true,
"mailNickname": "TestDG1",
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": [
"SMTP:testdg1@contoso.com"
],
"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": []
}
- 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": "admin@contoso.com",
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": "en-US",
"surname": "Contoso",
"userPrincipalName": "admin@contoso.com"
}
]
}
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": "testdg1@contoso.com",
"mailEnabled": true,
"mailNickname": "TestDG1",
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": [
"SMTP:testdg1@contoso.com"
],
"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?