Enumerating Replicas of an Application Directory Partition
When a replica of an application directory partition is added, the distinguished name of the nTDSDSA object for the domain controller that will contain the replica is added to the msDS-NC-Replica-Locations attribute of the crossRef object. The crossRef object used represents the application directory partition.
To enumerate the replicas for an application directory partition
- Search the Partitions container for a crossRef object that has an nCName attribute value that is equal to the distinguished name of the application directory partition.
- Use each value of the msDS-NC-Replica-Locations attribute of the crossRef object to bind to the nTDSDSA object of the server.
- Obtain the ADsPath for the parent of each nTDSDSA object. This is an object that represents the domain controller server. Use the ADsPath to bind to the server object.
- Obtain the dNSHostName attribute value of the server object. This is a single-value property that contains the DNS name of the server.
Due to replication latency and scheduled KCC run delays, it is possible the actual active replicas for an application directory partition may not match the list of domain controllers indicated by the msDS-NC-Replica-Locations attribute of the crossRef object. A more accurate, but less efficient way to determine the actual active replicas of an application directory partition is to search for all nTDSDSA objects in the forest that have a msDS-hasMasterNCs attribute that contains the distinguished name of the application directory partition. The msDS-hasMasterNCs attribute contains the distinguished names of all writable directory partitions that the domain controller hosts, including application directory partitions.