---
title: "AD Management with Nodinite LDAP Web API: Query Domain Infrastructure"
description: Active Directory operations with the Nodinite LDAP Web API. Query domain controllers, domains in forest, and global catalog servers with XML examples.
---

# AD Management with the Nodinite LDAP Web API

Active Directory infrastructure query operations using the :Nodinite: [LDAP Web API][Overview]. Discover domain controllers, forests, and global catalog servers programmatically.

✅ **Domain Controllers**: List all available DCs in the domain  
✅ **Forest Discovery**: Get all domains within the forest  
✅ **Global Catalog**: Query GC servers for cross-domain searches  
✅ **Read-Only**: Infrastructure queries return results in SearchResult  
✅ **DirectoryEntries**: Additional metadata provided for each result  

## Overview

AD operations are available in the `Operations` section of the `AD` record within the request message. These operations are read-only infrastructure queries that do not require a `With` record for search criteria.

Both XML and JSON formats are supported. See the [Request Schema][Request] for message structure details.

## Operations Summary

|Operation|Description|Parameters|  
|---|---|---|  
|[GetDomainControllers](#getdomaincontrollers)|List all domain controllers|None|  
|[GetDomainsInForest](#getdomainsinforest)|List all domains in the forest|None|  
|[GetGlobalCatalogServers](#getglobalcatalogservers)|List all Global Catalog servers|None|  

## GetDomainControllers

The `GetDomainControllers` operation retrieves all available domain controllers in the domain.

### Example: List All Domain Controllers

```xml
<ns0:LDAP xmlns:ns0="http://integrationsoftware.se/BizTalk/Adapters/LDAP/Request/1.0">
  <Batches guid="2B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8D">
    <Batch guid="3B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8E">      
        <AD>          
          <Operations>
            <GetDomainControllers/>
          </Operations>
        </AD>
    </Batch>    
  </Batches>
</ns0:LDAP>
```

>[!NOTE]
>Results are listed in the `SearchResult` record with additional information available in the child `DirectoryEntries` record.

### Response Details

The response includes:

* Domain controller names
* DirectoryEntries with detailed properties
* Server roles and capabilities
* Network addresses and configuration

## GetDomainsInForest

The `GetDomainsInForest` operation retrieves all available domains within the Active Directory forest.

### Example: List All Domains in the Forest

```xml
<ns0:LDAP xmlns:ns0="http://integrationsoftware.se/BizTalk/Adapters/LDAP/Request/1.0">
  <Batches guid="2B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8D">
    <Batch guid="3B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8E">
      <AD>
        <Operations>
          <GetDomainsInForest/>
        </Operations>
      </AD>
    </Batch>
  </Batches>
</ns0:LDAP>
```

>[!NOTE]
>Results are listed in the `SearchResult` record and include all domains within the forest structure.

### Use Cases

* **Multi-Domain Environments**: Discover all domains before performing cross-domain operations
* **Forest Topology**: Map the complete forest structure for documentation
* **Configuration Management**: Validate domain availability for integration workflows
* **Trust Relationships**: Identify domains for establishing or verifying trust configurations

## GetGlobalCatalogServers

The `GetGlobalCatalogServers` operation retrieves all servers marked as Global Catalog (GC) in the domain.

### Example: List All Global Catalog Servers

```xml
<ns0:LDAP xmlns:ns0="http://integrationsoftware.se/BizTalk/Adapters/LDAP/Request/1.0">
  <Batches guid="2B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8D">
    <Batch guid="3B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8E">      
        <AD>          
          <Operations>
            <GetGlobalCatalogServers/>
          </Operations>
        </AD>
    </Batch>    
  </Batches>
</ns0:LDAP>
```

>[!NOTE]
>Results are listed in the `SearchResult` record.

### Global Catalog Overview

Global Catalog servers contain a partial replica of all objects in the forest and are essential for:

* Universal group membership queries
* Cross-domain user authentication
* Forest-wide searches
* User Principal Name (UPN) lookups

## Common Use Cases

### Infrastructure Health Monitoring

Use `GetDomainControllers` and `GetGlobalCatalogServers` to verify availability of critical AD infrastructure before executing operations.

### Load Balancing & Failover

Query available domain controllers and GC servers to implement load balancing or failover logic in your integration solutions.

### Forest-Wide Operations

Combine `GetDomainsInForest` with user/group operations to perform cross-domain queries and modifications.

### Documentation & Auditing

Automatically generate infrastructure documentation by periodically querying AD topology and tracking changes over time.

## :fa-hand-point-right: Next Steps

* Review the [Request Schema][Request] for complete message structure  
* Explore the [Response Schema][Response] for understanding operation results  
* Learn about [User Management][User Management] for cross-domain user operations  
* Check [Logging][Logging] for troubleshooting infrastructure queries  

## :fa-link-horizontal: Related Topics

* [LDAP Web API Overview][Overview]  
* [Group Management][Group Management]  
* [OU Management][OU Management]  
* [Schema Management][Schema Management]  
* [Developer Guide][Features Overview]  

[Features Overview]:{ndr}/LDAP%20Web%20API/Features/Overview.md
[Group Management]:{ndr}/LDAP%20Web%20API/Features/Group%20Management.md
[Logging]:{ndr}/LDAP%20Web%20API/Troubleshooting/Logging.md
[OU Management]:{ndr}/LDAP%20Web%20API/Features/OU%20Management.md
[Overview]:{ndr}/LDAP%20Web%20API/Overview.md
[Request]:{ndr}/LDAP%20Web%20API/Features/Request.md
[Response]:{ndr}/LDAP%20Web%20API/Features/Response.md
[Schema Management]:{ndr}/LDAP%20Web%20API/Features/Schema%20Management.md
[User Management]:{ndr}/LDAP%20Web%20API/Features/User%20Management.md