---
title: activeDirectory query | Wartiva GraphQL API
description: Retrieves an endpoint's ActiveDirectory configuration by its graph object id: whether Active Directory is enabled, the domain and DNS forest.
url: https://wartiva.com/api-docs/queries/active-directory.html
updated: 2026-10-07
---

Endpoint configuration · GraphQL query

# `activeDirectory` query

Retrieves an endpoint's [ActiveDirectory](https://wartiva.com/api-docs/types/active-directory.html) configuration by its graph object id: whether Active Directory is enabled, the domain and DNS forest, the domain controller's name and address, the directory status, and the endpoint's domain role, on Windows, macOS, and Linux. Each [Endpoint](https://wartiva.com/api-docs/types/endpoint.html) has at most one, also reachable through its `activeDirectory` field; find them across endpoints with [graphSearch](https://wartiva.com/api-docs/queries/graph-search.html) on the ACTIVE_DIRECTORY object type. Returns a not-found error when no object has the id, and an error when the id belongs to another object type.

## Response

Returns an [`ActiveDirectoryPayload!`](https://wartiva.com/api-docs/types/active-directory-payload.html)

## Arguments

| Name | Description |
|---|---|
| `id` - [`ID!`](https://wartiva.com/api-docs/types/id.html) | The ActiveDirectory identifier. |
| `mockOptions` - [`MockDataInput`](https://wartiva.com/api-docs/types/mock-data-input.html) | Options for mock data generation. Options supported: key: "PLATFORM", value: OsPlatform example: "mockOptions": { "options": [ { "key": "PLATFORM", "value": "WINDOWS" } ] } |

## Example

### Query

```graphql
query activeDirectory(
  $id: ID!,
  $mockOptions: MockDataInput
) {
  activeDirectory(
    id: $id,
    mockOptions: $mockOptions
  ) {
    node {
      id
      orgId
      seen {
        ...SeenOnlineFragment
      }
      objectType
      objectTypeLabel
      displayName
      firstSeen
      lastSeen
      createdAt
      updatedAt
      snapshotInfo {
        ...GraphObjectSnapshotInfoFragment
      }
      endpoint {
        ...EndpointFragment
      }
      enabled
      name
      domainControllerName
      domainControllerIpAddress {
        ...IpAddressFragment
      }
      domainControllerAddressType
      dnsForestName
      status
      role
      osSpecific {
        ... on ActiveDirectoryWindows {
          ...ActiveDirectoryWindowsFragment
        }
        ... on ActiveDirectoryMacOS {
          ...ActiveDirectoryMacOSFragment
        }
        ... on ActiveDirectoryLinux {
          ...ActiveDirectoryLinuxFragment
        }
      }
      findings {
        ...FindingsPayloadFragment
      }
      issues {
        ...IssuesPayloadFragment
      }
      issuesSummary {
        ...IssuesSummaryFragment
      }
    }
  }
}

```

### Variables

```json
{
  "id": "4",
  "mockOptions": MockDataInput
}

```

### Response

```json
{"data": {"activeDirectory": {"node": ActiveDirectory}}}

```

---

Wartiva is in early access. Request access: https://wartiva.com/early-access.html  
All pages: https://wartiva.com/llms.txt
