Reputation: 179
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 [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.
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": []
}
]
}
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": []
}
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": []
}
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
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