List domainNameReferences
Namespace: microsoft.graph
Retrieve a list of directoryObject with a reference to the domain. The returned list will contain all directory objects that have a dependency on the domain.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Domain.Read.All | Domain.ReadWrite.All |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Domain.Read.All | Domain.ReadWrite.All |
Important
When an application queries a relationship that returns a directoryObject type collection, if it doesn't have permission to read a certain resource type, members of that type are returned but with limited information. For example, only the @odata.type property for the object type and the id is returned, while other properties are indicated as null
. With this behavior, applications can request the least privileged permissions they need, rather than rely on the set of Directory.* permissions. For details, see Limited information returned for inaccessible member objects.
Important
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation: Domain Name Administrator or Global Reader.
HTTP request
GET /domains/{id}/domainNameReferences
Optional query parameters
This method supports the $select
and $filter
OData Query Parameters to help customize the response. You can only filter by the OData type of the objects returned, for example, /domains/{domainId}/domainNameReferences/microsoft.graph.group
and /domains/{domainId}/domainNameReferences/microsoft.graph.user
.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and collection of directoryObject objects in the response body.
Example
Request
GET https://graph.microsoft.com/v1.0/domains/contoso.com/domainNameReferences
Response
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
"value": [
{
"@odata.type": "#microsoft.graph.user",
"@odata.id": "https://graph.microsoft.com/v2/927c6607-8060-4f4a-a5f8-34964ac78d70/directoryObjects/fc9a2c2b-1ddc-486d-a211-5fe8ca77fa1f/Microsoft.DirectoryServices.User",
"id": "fc9a2c2b-1ddc-486d-a211-5fe8ca77fa1f",
"accountEnabled": true,
"city": "Nairobi",
"createdDateTime": "2021-04-14T05:26:16Z",
"country": "Kenya",
"displayName": "Adele Vance",
"givenName": "Adele",
"mail": "AdeleV@Contoso.com",
"mailNickname": "AdeleV"
},
{
"@odata.type": "#microsoft.graph.group",
"@odata.id": "https://graph.microsoft.com/v2/927c6607-8060-4f4a-a5f8-34964ac78d70/directoryObjects/eac82bd3-931c-4d47-9e68-735595a8eb8a/Microsoft.DirectoryServices.Group",
"id": "eac82bd3-931c-4d47-9e68-735595a8eb8a",
"createdDateTime": "2021-04-14T06:59:47Z",
"createdByAppId": "00000005-0000-0ff1-ce00-000000000000",
"organizationId": "927c6607-8060-4f4a-a5f8-34964ac78d70",
"description": "Contribute your ideas and ask your questions to our leadership team. And tune in for regular Employee Q & A live events. You can learn more about what",
"displayName": "CEO Connection",
"expirationDateTime": "2021-10-11T06:59:47Z",
"groupTypes": [
"Unified"
],
"mail": "ceoconnection@Contoso.com",
"mailEnabled": true,
"mailNickname": "ceoconnection",
"resourceBehaviorOptions": [
"CalendarMemberReadOnly"
],
"visibility": "Public",
"writebackConfiguration": {
"isEnabled": null,
"onPremisesGroupType": null
}
}
]
}