Active Directory Replication Model Technical Reference
Active Directory Replication Model Technical Reference
Technical Reference
The Active Directory service replication model ensures that Active Directory data on one domain controller is consistent with the
replica of the same data on other domain controllers in the same domain. The Active Directory replication model determines how
changes to Active Directory data are propagated and tracked automatically between domain controllers. The replication model
allows directory data on each domain controller to be updated directly. Each domain controller maintains replication metadata
that indicates the update status both for itself and relative to other domain controllers. In addition, the replication model allows
each domain controller to request (pull) only changes that need to be replicated and to forward changes to other domain
controllers that need them.
Note
• This discussion of the replication model and related mechanisms for transferring directory data between domain controllers
does not include the topic of replication topology. Replication topology is the set of connections that are generated by the
Knowledge Consistency Checker (KCC) to enable replication to take place between domain controllers.
Active Directory is distributed by means of directory partitions. In addition to directory partitions that store forest‐wide data, each
domain controller stores a replica of a single domain directory partition, which contains data that is specific to one or more closely
aligned business units—the users, computers, organizational units, and network resources that are managed by the same set of
service and data administrators. Because each domain controller stores only one domain directory partition, Active Directory can
scale to hundreds or thousands of domains storing millions of objects.
To efficiently synchronize data between domain controllers that store the same domain, Active Directory replication transfers
updates according to directory partition. Each domain controller receives directory updates to the data that is stored in its domain
only, as well as updates that are stored in the two directory partitions that store configuration and schema data for the forest.
Note
• In Windows Server 2003 forests, domain controllers can also store application directory partitions, which store application data
that can be replicated to only the domain controllers that store the directory partition, irrespective of domain.
Active Directory replication manages the transfer of these updates to the appropriate domain controllers automatically, keeping
domain data up‐to‐date among all domain controllers in the domain, regardless of location. In the process, all domain controllers
in the forest are also updated with changes to forest‐wide data.
Multimaster Every domain controller can receive originating updates to data for Provides fault tolerance, eliminating
replication which it is authoritative, rather than having a single domain controller the dependency on a single domain
that receives all original updates (single‐master replication, such as controller to maintain directory
Windows NT 4.0 replication). operations.
Pull replication Domain controllers request (pull) changes rather than send (push) Reduces unnecessary network traffic.
changes that might not be needed.
Store‐and‐ Each domain controller communicates with a subset of domain Balances the replication load among
forward controllers to transfer replication changes, rather than one domain many domain controllers.
replication controller being responsible for communicating with every other
domain controller that requires the change.
State‐based Each domain controller tracks the state of replication updates. Conflicts and unnecessary replication
replication are reduced.
The Active Directory replication model ensures:
• Domain controller availability. Multimaster replication ensures that all domain controllers are available for updates,
eliminating the potential for slow service if only a single updatable domain controller were available.
• Efficient transfer of data. State‐based and pull replication ensures the minimum replication traffic and the maximum efficiency
to retrieve only the changes that are needed.
•
Reliable consistency. Directory consistency is guaranteed within the same period of replication latency.
• Conflict resolution. Even if two administrators change the same attribute on different domain controllers at the same time,
conflict resolution ensures that only one of the values is replicated to all domain controllers.
Replication Latency
Multimaster replication involves latency — the period of time for an update that occurs on the originating domain controller to
reach all other domain controllers that need it. To address replication latency, multimaster replication ensures loose consistency
with convergence, as follows:
• Loose consistency means that the replicas are not guaranteed to be consistent with each other at any particular point in time
because changes can originate from any replica at any time.
• Convergence means that if the system is allowed to reach a steady state in which no new updates are occurring and all previous
updates have been completely replicated, all replicas of the same directory partition are guaranteed to converge on the same
set of values.
With multimaster replication, it is not necessary for every domain controller to replicate with every other domain controller.
Instead, the system implements a robust set of connections that determines which domain controllers replicate to which other
domain controllers to ensure that networks are not overloaded with replication traffic and that replication latency is not so long
that it inconveniences users. The set of connections through which changes are replicated to domain controllers in an enterprise is
called the replication topology.
Although it involves latency, multimaster update capability provides high availability of write access to directory objects because
several servers can contain writable copies of an object. Each domain controller in the domain can accept updates independently,
without communicating with other domain controllers. Active Directory replication resolves any conflicts that occur when multiple
updates are made to a single directory object.
Active Directory replication relies on the current “state” (the current values of all objects) of the source replica instead of logs. The
current state includes metadata that is used to resolve conflicts and to avoid sending the full replica on each replication cycle.
Generally speaking, a directory partition replica maintains all of its objects in a list ordered by last modification. This list is a log of
sorts, but one whose size is a tiny fraction of the size of the replica itself. A typical replication request can be satisfied by
examining only the last few objects on the list because the replication destination server is aware of how much of its replication
source’s list of changes have already been processed.
Thus, Active Directory replicates directory data updates at the attribute level. In addition, updates from the same directory
partition are replicated as a unit to the corresponding replica on the destination domain controller over the same connection to
optimize network usage.
The information in this section applies to organizations that are designing, deploying, or operating an Active Directory
infrastructure that satisfies the following requirements:
• A Domain Name System (DNS) infrastructure is in place that manages the name resolution for domain controllers in the forest.
Active Directory‐integrated DNS is assumed, wherein DNS zone data is stored in Active Directory and is replicated to all domain
controllers that are DNS servers.
• All Active Directory sites have local area network (LAN) connectivity.
• IP connectivity is available between all datacenter locations and branch sites.
The limits for data that can be replicated in one replication cycle are as follows:
• Values that can be transferred in one replication cycle (replication of the current set of updates between a source and
destination domain controller): no limit.
• Values that can be transferred in one replication packet: approximately 100. Replication exchanges continue during the course
of one replication cycle until no values are left to send.
• Values that can be written in a single database transaction: 5,000. The effect of this limit depends on the forest functional level:
• Windows 2000 forest functional level: The minimum unit of replication at this level is the entire attribute. Therefore,
changes to any value in the linked, multivalued member attribute results in replicating the entire attribute. For this
reason, the supported size of group membership is limited to 5,000.
• Windows Server 2003 or Windows Server 2003 interim forest functional level: The minimum unit of replication is a single
value of a linked, multivalued attribute. Therefore, the limitation on group membership is effectively removed.
This section covers the interactions that take place between individual domain controllers to synchronize directory data in an
Active Directory forest.
When SMTP is used for the replication transport, Ismserv.exe on the source domain controller uses the Collaborative Data Object
(CDO) library to build an SMTP file on disk with the replication data as the attached mail message. The message file is placed in a
queue directory. When the mail is scheduled for transfer by the mail server application, the SMTP service (Smtpsvc) delivers the
mail message to the destination domain controller over TCP/IP and places the file in the drop directory on the destination domain
controller. Ismserv.exe applies the updates on the destination.
The following diagram shows the client‐server architecture for replication clients and LDAP clients.
Replication and LDAP Client‐Server Architecture
CDO library Used by Ismserv.exe to package replication data into a mail message.
Smtpsvc SMTP service.
Note
• If Windows NT 4.0 backup domain controllers (BDCs) are operating in the forest, Windows NT4 Net APIs provide an entry to the
security accounts manager (SAM) on the primary domain controller (PDC) emulator.
The protocols that are used by Active Directory replication are described in the following table. RPC and SMTP are the replication
transport protocols. LDAP is a directory access protocol, and IP is a network wire protocol.
LDAP The primary directory access protocol for Active Directory. Windows Server 2003 family, Windows XP,
Windows 2000 Server family, and Windows 2000 Professional clients, as well as Windows 98, Windows 95,
and Windows NT 4.0 clients that have the Active Directory client components installed, use LDAP v3 to
connect to Active Directory.
IP Routable protocol that is responsible for the addressing, routing, and fragmenting of packets by the
sending node. IP is required for Active Directory replication.
Replication RPC The Directory Replication Service (Drsuapi) RPC protocol, used in the enabling of administration and
monitoring of Active Directory replication, to communicate replication status and topology and network
topology from a client running administrative tools to a domain controller. RPC is required by Active
Directory replication.
Replication Simple Replication protocol that can be used by Active Directory replication over IP network transport for
Mail Transfer message‐based replication between sites only and for non‐domain replication only.
Protocol (SMTP)
Replication Subsystem
Within the directory service component of the Active Directory architecture, the replication subsystem interacts with the
operational layer to implement replication changes on the destination domain controller. The replication subsystem also
determines the changes that a replication partner already has or those that are needed.
The database layer manages the database capability of the directory service. The extensible storage engine (Esent.dll)
communicates directly with individual records in the directory data store.
The following diagram shows the replication subsystem components.
The components of the replication subsystem are described in the following table.
Replication Subsystem Components
Component Description
Ntdsa.dll Directory system agent (DSA), which provides the interfaces through which directory clients and other
directory servers gain access to the directory database.
Replication Directory Replication System (DRS) interface, which communicates with the database through RPC.
Component Description
Operational layer Performs low‐level operations on the database without regard for protocol.
Database layer API that resides within Ntdsa.dll and provides an interface between applications and the directory
database to protect the database from direct interaction with applications.
Extensible storage Manages the tables of records, each with one or more columns that comprise the directory database.
engine (ESE)
Ntds.dit The directory database file.
Multimaster All domain controllers accept LDAP requests for changes to attributes of Active LDAP update
replication Directory objects for which they are authoritative, subject to security constraints that Directory partitions
are in place. Each originating update is replicated to one or more other domain Change notification
controllers, which record it as a replicated update. Change tracking
Conflict resolution
Pull replication When an update occurs on a domain controller, it notifies its replication partner. The DNS name resolution
partner domain controller responds by requesting (pulling) the changes from the source Kerberos
domain controller. authentication
Change tracking
Change notification
Change request
Store‐and‐ Domain controllers store changes received from replication partners and forward the Change tracking
forward changes to other domain controllers so that the originating domain controller for each Kerberos
replication change is not required to transfer changes to every other domain controller that authentication
requires the change. DNS name resolution
Change notification
Change request
State‐based Active Directory replication is driven by the difference between the current “state” (the Change‐tracking
replication current values of all attributes) of the directory partition replica on the source and metadata:
destination domain controllers. This state includes metadata that is used to resolve • Update sequence
conflicts and to avoid sending the full replica on each replication cycle. number (USN)
counter
• Up‐to‐dateness
vector
• High‐watermark
These mechanisms are implemented by the replication system in a sequence of events that occurs between two domain
controllers.
The following diagram shows a simplified version of the sequence between source and destination domain controllers when the
source initiates replication by sending a change notification.
Replication Sequence
Active Directory data is logically partitioned so that all domain controllers in the forest do not store all objects in the directory.
Active Directory objects are instances of schema‐defined classes, which consist of named sets of attributes. Schema definitions
determine whether an attribute can be administratively changed. Attributes that cannot be changed are never updated and
therefore never replicated. However, most Active Directory objects have attribute values that can be updated.
Different categories of data are stored in replicas of different directory partitions, as follows:
• Domain data that is stored in domain directory partitions:
• Every domain controller stores one writable domain directory partition.
• A domain controller that is a global catalog server stores one writable domain directory partition and a partial, read‐only
replica of every other domain in the forest. Global catalog read‐only replicas contain a partial set of attributes for every
object in the domain.
• Configuration data: Every domain controller stores one writable configuration directory partition that stores forest‐wide data
controlling site and replication operations.
• Schema data: Every domain controller stores one writable schema partition that stores schema definitions for the forest.
Although the schema directory partition is writable, schema updates are allowed on only the domain controller that holds the
role of schema operations master.
• Application data: Domain controllers that are running Windows Server 2003 can store directory partitions that store application
data. Application directory partition replicas can be replicated to any set of domain controllers in a forest, irrespective of
domain.
Changes to Attributes
Active Directory updates originate on one domain controller (originating updates) and the same update is subsequently made on
other domain controllers during the replication process (replicated updates).
Object update behaviour is consistent and predictable: when a set of changes is made to a specific directory partition replica,
those changes will be propagated to all other domain controllers that store replicas of the directory partition. How soon the
changes are applied depends on the distance between the domain controllers and whether the change must be sent to other
sites.
The following key points are central to understanding the behaviour of Active Directory updates:
• Changes occur at the attribute level; only the changed attribute value is replicated, not the entire object.
• At the time of replication, only the current value of an attribute that has changed is replicated. If an attribute value has changed
multiple times between replication cycles (for example, between scheduled occurrences of intersite replication), only the
current value is replicated.
• The smallest change that can be replicated in Windows 2000 Active Directory is an entire attribute; even if the attribute is
linked and multivalued, all values replicate as a single change. The smallest change that can be replicated in
Windows Server 2003 Active Directory is a separate value in a multivalued attribute that is linked. This Windows Server 2003
feature is called linked‐value replication.
• The individual values of a multivalued attribute are replicated separately under the following conditions:
• The forest functional level is Windows Server 2003 interim or Windows Server 2003.
• The attribute is linked. Linked attributes have the following characteristics:
The attribute has distinguished name syntax.
The attribute is marked as linked in the schema.
• An attribute is available for replication as soon as it is written.
• Replication is store‐and‐forward and moves sequentially through a set of connected domain controllers that host directory
partition replicas.
• Multimaster conflict resolution is effective without depending on clock synchronization.
• Originating updates to a single object are written to the database in the same transaction, so partially written objects are not
possible and a consistent view of the object is maintained.
• For replicated updates to large numbers of values in linked multivalued attributes, such as the member attribute of a group,
updates are not always guaranteed to be applied in the same transaction. In this case, the updates are guaranteed to be
applied in one or more subsequent transactions in the same replication cycle (all updates from one source are applied at the
destination).
• After a replication cycle is initiated, all available changes to a directory partition on the source domain controller are sent to the
destination domain controller, including changes that occur while the replication cycle is in progress.
Prior to upgrading a domain controller from Windows 2000 Server to Windows Server 2003, you must update the schema to be
compatible with Windows Server 2003. When you run Adprep.exe, Windows Server 2003 schema is installed in the forest. This
process upgrades the schema on each Windows 2000–based domain controller. Thereafter, you can begin upgrading domain
controllers to Windows Server 2003.
Note
• The Windows Server 2003 schema update adds 25 indexed attributes to the schema directory partition. An update of this size
can cause replication delays in a large database. For this reason, domain controllers that are running Windows 2000 Server
must be running at a minimum Windows 2000 Service Pack 2 (SP2) plus all additional Windows updates. However, it is highly
recommended that you install Windows 2000 Service Pack 3 (SP3) on all domain controllers prior to preparing your
infrastructure for upgrade to the Windows Server 2003 operating system.
Effect of Raising the Forest Functional Level on Existing Linked, Multivalued Attributes
Existing linked, multivalued attributes are not directly affected when you raise the forest functional level to enable linked‐value
replication. These attribute values are converted to replicate as single values only when they are modified. This design avoids the
performance effects that would potentially result from rewriting the existing member attribute values of all group objects in the
forest at the same time.
Because the member attribute is not converted until it is modified, a group that exceeded the 5,000‐member limit in
Windows 2000 continues to represent a replication issue because the original set of members continues to replicate as a unit
under the new forest functional level. New members that are added and any member values that are updated replicate separately
thereafter. Therefore, if the groups that were created in Windows 2000 do not exceed the 5,000‐member limit, no replication
issues are associated with the group.
Raising the forest functional level does affect the ability of an authoritative restore process to restore the back‐links of a restored
object that has one or more single‐valued or multivalued linked attributes. The version of Ntdsutil that is included with
Windows Server 2003 provides this functionality automatically when the forest has a functional level of Windows Server 2003
interim or Windows Server 2003. The version of Ntdsutil that is included with Windows Server 2003 SP1 also provides the ability
to restore back‐links that were created before the forest functional level was raised to Windows Server 2003 interim or
Windows Server 2003.
Each LDAP request generates a separate write transaction. An LDAP directory service processes each write request as an atomic
transaction; that is, the transaction is either completed in full or not applied at all. The practical limit to the number of values that
can be written in one LDAP transaction is approximately 5,000 values added, modified, or deleted at the same time.
A write request either commits and all its effects are durable, or it fails before completion and has no effect. A write request that
commits is called an originating update. An originating update is initiated and committed at a specific replica. The absolute success
or failure of an update applies even for requests that might affect several attributes of a single object, such as Add or Modify. In
this case, if one attribute update fails, they all fail and the object is not updated.
An originating update enforces schema restrictions, including allowable parent object types and syntax for mandatory and
optional attributes for an object. The restrictions are enforced according to the schema that exists on the domain controller at the
moment of the update.
Originating Add
An Add request makes a new object with a unique objectGUID attribute. The values of all replicated attributes that are set by the
Add request are stamped Version = 1. The Add request fails immediately if the parent object does not exist or if the originating
domain controller does not contain a writable replica of the parent object’s directory partition.
Originating Modify
All Modify operations replace the current value of an attribute with a new value. A modify request can specify one of the
following:
• That an attribute be deleted from the object. Attribute deletion is best thought of as replacing the attribute value with NULL.
The NULL value occupies no storage of its own but does carry a stamp, as does any value that is stored as a directory attribute.
• That a value be added to the current value of an attribute, as when modifying an attribute that can have multiple values. The
effect is to replace the current values with the current values plus the added value.
For each attribute in the request, a Modify request compares the new value in the request with the existing value. If the values are
the same, the request to modify that attribute is ignored. If the resulting Modify request does not change any attributes of the
object, the entire request is ignored.
Otherwise, a Modify request computes a stamp in the metadata for each new replicated attribute value by reading the version
from the existing value (version=0 for an attribute that has never been written) and then adding 1 to this value. The Modify
request replaces the old stamp values with new stamp values.
Originating Move
A Move request is essentially a special Modify request for a single attribute, the name attribute. The operation proceeds as
described for the Modify request.
Originating Delete
A Delete request is essentially a special Modify request that does the following series of operations:
1. Sets the isDeleted attribute to TRUE, which marks the object as a tombstone (an object that has been deleted but not fully
removed from the directory).
2. Changes the relative distinguished name of the object to a value that cannot be set by an LDAP application (a value that is
impossible).
3. Strips all attributes that are not needed by Active Directory. A few important attributes (including objectGUID, objectSid,
distinguishedName, nTSecurityDescriptor, and uSNChanged) are preserved on the tombstone.
Note
• Because these attributes are preserved, tombstones can be restored (reanimated) by applications that use the LDAP API
for undeleting an object.
• On domain controllers running Windows Server 2003 with SP1, the sIDHistory attribute is also retained on tombstone
objects.
4. Moves the tombstone to the Deleted Objects container, which is a hidden container within those directory partitions that
allow deletions.
On domain controllers running Windows Server 2003, you can restore tombstones in the Deleted Objects container to an active
state.
For example, the manager of a user object can be changed at one domain controller at the same time the address of the same
user is changed at another domain controller. A third domain controller might receive these changes separately to the user object
and in turn replicate the changes to a fourth domain controller in a single replicated update.
To avoid endless replication of the same update and reapplication of an update that is received from different replication
partners, a domain controller must be able to recognize replicated updates that it has already received as opposed to those that it
has not. Some directory services use timestamps to determine what changes need to be propagated, on the basis of preserving
the last write. But keeping time closely synchronized in a large network is difficult. When the latest time of a directory write is the
only means of determining which of two changes is recorded and replicated, skewed time on a domain controller can result in
data loss or directory corruption.
Active Directory replication does not primarily depend on time to determine what changes need to be propagated. Instead it uses
update sequence numbers (USNs) that are assigned by a counter that is local to each domain controller. Because these USN
counters are local, it is easy to ensure that they are reliable and never run backward (that is, they cannot decrease in value).
Note
• Replication uses Kerberos v 5 authentication protocol for security, which does require that the time services on domain
controllers are synchronized.
When a conflict occurs, instead of using timestamps as the primary mechanism to determine what updates are preserved, Active
Directory uses volatility (number of changes) as the first element of the per‐attribute stamps that are compared during conflict
resolution. The second element is a timestamp. Therefore, if an attribute is updated once on domain controller A and once on
domain controller B, the last writer’s update is preserved. But if the attribute is updated on domain controller A, then on domain
controller B, and then again on domain controller A, the update of domain controller A is preserved even if the clock of domain
controller B is set forward from that of domain controller A. With Active Directory, clock skew can never prevent a value from
being overwritten.
Domain controllers use USNs to simplify recovery after a failure. When a domain controller is restored following a failure, it
queries its replication partners for changes with USNs greater than the USN of the last change it received from each partner.
You do not need to be concerned with USNs and their implications unless you experience problems with replication that require
troubleshooting.
Server Object GUID (DSA GUID) and Server Database GUID (Invocation ID)
The server object that represents a domain controller in the Sites container of the configuration directory partition has a globally
unique identifier (GUID) that identifies it to the replication system as a domain controller. This GUID, called the DSA (Directory
System Agent) GUID, is used in USNs to track originating updates. It is also used by domain controllers to locate replication
partners. The DSA GUID is the GUID of the NTDS Settings object (class nTDSDSA), which is a child object of the server object. Its
value is stored in the objectGUID attribute of the NTDS Settings object.
The DSA GUID is created when Active Directory is initially installed on the domain controller and destroyed only if Active Directory
is removed from the domain controller. The DSA GUID ensures that the DSA remains recognizable when a domain controller is
renamed. The DSA GUID is not affected by the Active Directory restore process.
The Active Directory database has its own GUID, which the DSA uses to identify the database instance (version of the database).
The database GUID is stored in the invocationId attribute on the NTDS Settings object. Unlike the DSA GUID, which never changes
for the lifetime of the domain controller, the invocation ID is changed during an Active Directory restore process to ensure
replication consistency.
On domain controllers that are running Windows Server 2003, the invocation ID also changes when an application directory
partition is removed from or added to the domain controller.
The next diagram shows the change to the destination domain controller when the new user object is replicated. The object is
created as a replicated update on DC2. Notice that the per‐attribute originating USN and stamp (version, originating time,
originating DC) are replicated from DC1 to DC2, but the per‐attribute local USN and per‐object uSNChanged are unique to DC2.
2. Replication‐related Data on DC2 When a New User Object is Replicated From DC1
The following information is transferred in the metadata of an updated attribute value from the source domain controller to the
destination domain controller:
• The originating USN value for the updated attribute, which is the USN assigned by the domain controller on which the update
was made.
• The stamp, which is used to resolve conflicts.
The next diagram illustrates the change in the replicated object on DC2 when someone changes the password (the userPassword
property in the diagram) of the object on that domain controller. By this time, the current USN on DC2 has increased from 1746 to
2001. The update request changes the password and increments the current USN to 2002 on DC2. The request also sets the
password attribute’s originating USN and local USN to 2002 and creates a new stamp for the password value. The version number
of this password’s stamp is 2, which is one version number higher than the version of the previous password.
3. Replication‐related Data on DC2 After the User Password Value Has Been Changed on DC2
In the next diagram, the changed password is now replicated back to the original domain controller, whose current USN has
increased to 5039. The replicated update increments the current USN of DC1 to 5040. The per‐attribute originating USN and
stamp (version, originating time, originating DC) are replicated from DC2 to DC1, and the per‐attribute local USN and per‐object
uSNChanged values are set to 5040.
4. Replication‐related Data on DC1 After the Password Change Has Replicated to DC1
Two values are used by source and destination domain controllers to filter updates when the destination requests changes from
the source replication partner:
• Up‐to‐dateness vector. The current status of the latest originating updates to occur on all domain controllers that store a
replica of a specific directory partition.
• High‐watermark (direct up‐to‐dateness vector). The latest originating update to a specific directory partition that has been
received by a destination from a specific source replication partner during the current replication cycle.
Both of these values specify the invocation ID of the source domain controller.
The up‐to‐dateness vector contains an entry for each domain controller that holds a full replica of the directory partition. The up‐
to‐dateness vector values include the database GUID (invocation ID) of the source domain controller and the highest originating
write (based on the USN) received from the source domain controller. If the up‐to‐dateness entry that corresponds to source
domain controller X contains the USN n, the destination domain controller guarantees that it holds all updates to a specific
directory partition that originated at domain controller X and that have an originating USN value of less than or equal to n.
If the destination already has an up‐to‐date value, the source domain controller does not send that attribute. If the source has no
attributes to send for an object, it sends no information at all about that object.
At the completion of a successful replication cycle between two replication partners, the source domain controller returns its up‐
to‐dateness vector to the destination, including the highest originating USN on the source domain controller. The destination
merges this information into its up‐to‐dateness vector. In this way, the destination tracks the latest originating update it has
received from each partner, as well as the status of every other domain controller that stores a replica of the directory partition.
By examining the timestamps, a domain controller can quickly identify other domain controllers that are not replicating. Warning
messages are posted to the event log on each domain controller when non‐replicating partners are discovered (Event ID 1864 in
the Directory Service event log).
The up‐to‐dateness vector and the high‐watermark are complementary filter mechanisms that work together to decrease
replication latency. Whereas the high‐watermark prevents irrelevant objects from being considered by the source domain
controller with respect to a single destination, the up‐to‐dateness vector helps the source domain controller to filter irrelevant
attributes (and entire objects if all attributes are filtered) on the basis of the relationships between all sources of originating
updates and a single destination.
For a specific directory partition, a domain controller maintains a high‐watermark value for only those domain controllers from
which it requests changes, but it maintains an up‐to‐dateness vector entry for every domain controller that has ever performed an
originating update, which is typically every domain controller that holds a full replica of the directory partition.
Two different originating writes of a specific attribute of a particular object cannot assign the same stamp because each
originating write advances the version at a specified originating domain controller. The originating time does not contribute to
uniqueness. Replicated writes cannot decrease the version because values with smaller versions lose during conflict resolution.
You can see all three components of the stamp in the output of the repadmin /showobjmeta command.
In the case of a conflict, the ordering of stamps allows a consistent resolution, as described in the following table.
Replication Conflict Resolution
Replication
Description Resolution
Conflict
Attribute value A Modify operation sets the value of an The attribute value at all domain controllers is the value with the
conflict attribute. Concurrently, at another domain larger version number in its stamp.
controller, a Modify operation sets the
value of the same attribute to a different
value.
Add or Move An Add or Move operation makes an At all domain controllers, the parent object is deleted and the
under deleted object a child of parent object. child object is a child of the special LostAndFound container in the
parent, Delete Concurrently, at another domain directory partition. Stamps are not involved in the resolution.
non‐leaf object controller, a Delete operation deletes the
parent object.
Relative An Add or Move operation names a child The child object whose naming attribute has the larger version
distinguished object below a parent object. number in its stamp keeps its given name. The child object whose
name conflict Concurrently, at another domain relative distinguished name attribute (for example, CN for most
controller, an Add or Move operation objects, OU for organizational units, DC for domain components)
names a different child of the same parent has the smaller version number in its stamp is named by the
with the same child name, resulting in two following convention: At all domain controllers, a system‐assigned
child objects with identical relative value that is unique to the conflicting name and cannot conflict
distinguished name values below the same with any client‐assigned value is assigned to the child object. For
parent object. example, if the relative distinguished name of a child object was
“CN=ABC” before conflict resolution, its relative distinguished
name after resolution is “CN=ABC*CNF:<GUID>,” where “*”
represents a reserved character, “CNF” is a constant that
indicates a conflict resolution, and “<GUID>” represents a
printable representation of the objectGUID attribute value.
For example, if you set the tombstone lifetime to 30 days and the replTopologyStayOfExecution value to 20 days, the actual stay‐
of‐execution value is 15 days.
The root object of each directory partition replica has a multivalued attribute repsFrom that contains configuration and persistent
state information associated with inbound replication from each source replica of that directory partition. A destination domain
controller uses this information to poll source domain controllers for replication changes. The Knowledge Consistency Checker
(KCC) is the replication topology component that manages creation of connection objects. When the KCC detects a repsFrom
value with no corresponding connection object, as is the case when the NTDS Settings object has been deleted, the KCC checks the
tombstone for the NTDS Settings object for the time it was deleted and compares that time to the interval in
replTopologyStayOfExecution. If the NTDS Settings object has been deleted for a time that is equal to or greater than the value in
replTopologyStayOfExecution, then the KCC removes the repsFrom value and replication is no longer attempted with the deleted
server.
Prior to the stay‐of‐execution lifetime, you can see evidence of failed replication attempts in the Directory Service event log and in
the output of Windows Support tools such as Repadmin.exe. When replication attempts are from a server designated as
<unknown>, they are likely due to the stay‐of‐execution mechanism.
Linked Attributes
A linked attribute represents an interobject, distinguished‐name reference. Linked attributes occur in pairs — forward link and
backward link (back‐link). The forward link is the linked attribute on the source object (for example, the member attribute on the
group object), while the backward link is the linked attribute on the target object (for example, the memberOf attribute on the
user object). A back‐link value on any object instance consists of the distinguished names of all the objects that have the object's
distinguished name set in their corresponding forward link. For example, manager and directReports are a pair of linked
attributes, where manager is the forward link and directReports is the back‐link. If Bill is Joe's manager and the distinguished
name of Bill's user object is stored in the manager attribute of Joe's user object, then the distinguished name of Joe's user object
appears in the directReports attribute of Bill's user object.
A linked attribute can have either single or multiple values. For example, the manager attribute identifies the distinguished name
of a single manager of the object or objects that are managed. The directReports attribute of a user object can have multiple
values of user names.
The relationships between linked attributes are stored in a separate table in the directory database as link pairs. The matching pair
of Link IDs (defined as any two numbers 2N and 2N+1) tie the attributes together. For example, the member attribute has a link ID
of 2 and the memberOf attribute has a link ID of 3. Because the member and the memberOf attributes are linked in the database
and indexed for searching, the directory can be examined for all records in which the link pair is member/memberOf and the
memberOf attribute identifies the group (for example, “What user objects have group X as a value in their memberOf
attribute?”).
Attributes are marked in the schema as being linked. Attributes with the distinguished name syntax Object(DS‐DN), Object(DN‐
String), or Object(DN‐Binary) can be linked, but not all such attributes are linked.
Nonlinked Attributes
Nonlinked, distinguished‐name attributes reference other objects in the same way as linked attributes do except that their
behaviour is different when a referred‐to object is deleted, as described in “Replication of Deletion Updates” later in this section.
In addition, nonlinked, multivalued attributes have an approximate limit of 1200 values (increased from the Windows 2000 Server
limit of approximately 800 values). This limit is based on an approximate maximum page size of 8 kilobytes. For attributes of this
maximum size, there are no storage or replication drawbacks or limitations.
Individual values of a multivalued attribute have slightly different rules. On origination, each unique value is assigned its own
originating USN. The values replicate out independently, in roughly increasing USN order; however, atomicity between values is
not guaranteed. When a set of values is applied on the destination domain controller, they are applied in batches to the same
object. The batch size is approximately 100 multivalues. Therefore, when they are written on the destination domain controller,
their originating USNs are still different, but the values on the same object, in groups of 100, have the same local USN.
The issue for an update transaction, then, is at what points in the replication stream the application of an update can be
interrupted and the effect of interruption on the end state. For inbound replication, the unit of transaction is the entire object for
nonlinked attributes. For linked attributes, the unit of transaction is the batch of values for the same object. Therefore, it is
possible for a replicated update to a single object that has linked values to occur in more than one transaction. However,
transactions to apply all updates to the same object are guaranteed to occur during the same replication cycle.
Now, suppose that the number of nonlinked changes is sufficiently large that the values fill an entire replication packet. When
both linked and nonlinked attributes are replicated, this scenario results in a set of changes that are made to one of the objects
spanning multiple replication packets. All nonlinked values for a single object are included in one packet, but linked values for the
same object can span multiple packets. Therefore, the write transaction at the destination can occur out of update order, and
replicated updates to a single object can require multiple transactions.
In addition, when the object already exists at the destination, although replication of nonlinked attributes occurs first, transaction
of nonlinked attribute updates before linked attribute updates is not guaranteed. However, nonlinked updates are generally
applied before linked updates at the destination.
For applications that depend on updates being written in update order, the prioritized implementation of replicated linked and
nonlinked attribute updates can occasionally result in unexpected behaviour.
These conditions have the following impacts on replication, most notably for group and distribution list objects:
• Lost changes: If values of the same multivalued attribute are updated on two different domain controllers during a period of
replication latency, the most recently changed replica of the attribute with all its multiple values is replicated and any earlier
changes are lost. Changes to the separate values are not merged.
Note
• Because all changes to an object must be written in the same database transaction, multiple changes to a single group
object can take a relatively long time to be written, which increases the likelihood of another change occurring to the
same object prior to the completion of the original write.
• Excessive network bandwidth consumption: For example, when one member is added to a group of 3,000 members, the
member attribute with all 3,001 values is transmitted between domain controllers. Transmission of all values to apply a change
to only the updated value or values is inefficient use of network resources.
These limitations are effectively removed in a forest that has a forest functional level of Windows Server 2003 or
Windows Server 2003 interim. At these levels, linked‐value replication accommodates replication of individually updated member
values.
In a Windows 2000 forest, this condition results in replication of the entire linked attribute. In a forest with a functional level of
Windows Server 2003 or Windows Server 2003 interim, this condition is replicated on a per‐value basis. For example, if a user is
removed from a group, the user value in the member attribute is marked “absent” in the database so that its condition can be
replicated, much like a tombstone.
The deletion of the user object from the group replicates as an absent value in the member attribute of the group. After a
tombstone lifetime, absent values are physically removed from the database. Until that time, the link value remains in the
database. Such absent values can be restored prior to the end of the tombstone lifetime. If you add the user back to the group
prior to the end of a tombstone lifetime, the link value is restored in the database by the value being marked "present."
A registry setting on domain controllers that are running Windows Server 2003 or Windows 2000 Server with SP3 provides a
consistency value that determines whether a domain controller replicates and reanimates an updated object that has been
deleted from all other replicas, or whether replication of such objects is blocked. The default settings are different on domain
controllers that are running Windows 2000 Server with SP3 and Windows Server 2003.
This mechanism can be used to cause lingering objects to be reanimated across the entire forest. If a lingering object is discovered
and its presence is intended, then perform any update to the object. As long as replication consistency is set to loose (strict
replication consistency is disabled) on all domain controllers, the object will be reanimated as it replicates around the forest.
Loose replication consistency is the default setting for domain controllers that are running Windows 2000 Server with SP3 or later.
The Windows 2000 Server default is not changed by upgrading to Windows Server 2003; strict replication consistency remains
disabled and replication is allowed to proceed. Keeping the Windows 2000 Server setting is required to ensure that the upgraded
domain and forest are consistent with Windows 2000 Server functionality. You must change the setting manually following the
upgrade.
RemoveLingeringObjects Implementation
When you run repadmin /removelingeringobjects, the tool performs the following steps to compare the directories of the source
and destination domain controllers and log (or remove) any found lingering objects:
1. Check to ensure that the directory partition and the source domain controller are valid.
2. Verify that the user has the DS‐Replication‐Manage‐Topology extended right on the directory partition container object
specified in <NC>. This extended right is required to verify object state between two domain controllers. Members of the
Domain Admins group have this right by default.
3. Ensure that both source and destination use the same objects for comparison by merging the up‐to‐dateness vectors to filter
out any objects that have not replicated from the source to the destination or from the destination to the source. This check
rules out a lingering object on the destination if the destination has not received the tombstone from the source, and vice
versa. Any such nonreplicated objects are removed from the comparison.
4. Create the list of object GUIDs for each domain controller to be compared. Examine the metadata of each object and use the
merged up‐to‐dateness vector to determine whether the object should be present on both source and destination.
5. For each GUID that is in the list for the destination, determine if it is in the list of GUIDs for the source.
6. If a GUID is not found on the source, the object is identified to be outdated on the destination and is either displayed or
deleted on the destination server. If advisory mode has been specified, the GUID is displayed only.
Nonauthoritative Restore
Nonauthoritative restore is the default method of performing a restore of Active Directory, and it is used in the majority of restore
situations, such as domain controller hard disk failure. Nonauthoritative restore is performed by using the backup tool that you
used to create the backup file. A nonauthoritative restore returns Active Directory on the domain controller to a state that is
consistent with the time that the backup was taken. When the domain controller restarts following the restore process, it requests
changes from its replication partners. Through the normal replication process, the restored domain controller receives any
directory changes that have occurred since the time of the backup.
Because the restore process does not restore any previously deleted data to Active Directory, it is described as nonauthoritative.
The following example illustrates the process of replication between a set of domain controllers before and after nonauthoritative
restore, including the metadata changes that determine the effect of the restore operation. In this example, three domain
controllers (DC1, DC2, and DC3) exist as part of the Active Directory replication topology. The scenario includes the following
steps:
Step 1
Prior to backup, DC1 maintains replication information about itself and its replication partners:
• Its own invocation ID (database GUID)
• Highest USN that it has committed for changes to the local database.
• Replication metadata for its two replication partners, DC2 and DC3:
• Invocation ID of the local Active Directory database of each domain controller.
• The up‐to‐dateness vector, as shown in the table below.
Step 2
Some changes have been made to the Active Directory database on DC1 since Step 1, which result in advancing the current USN
on DC1 to 35. At this point, DC1 is backed up.
Step 3
A total of 14 additional change changes have been made to the local Active Directory database on DC1, advancing the highest
committed USN on DC1 to 49. DC1 now begins replicating these changes to DC2. After replicating 12 of the 14 changes to DC2,
DC1 becomes unavailable due to hard drive corruption. As a result, DC2 has USN 47 as the last change it received from DC1. At this
point, the up‐to‐dateness vector on DC2 shows a highest committed USN of 47 for DC1.
Step 4
A nonauthoritative restore has been completed and DC1 is restarted. During the restore process a new invocation ID has been
assigned to the local Active Directory database on DC1. For replication purposes, DC1 adds its old invocation ID (GUID1) and
highest committed USN of 35 to its up‐to‐dateness vector, effectively restoring it to its state as of Step 2.
Step 5
DC1 replicates in the 12 changes that were saved to DC2 before the restore (which corresponds to Step 3 in the following table).
The last two changes that occurred as originating updates on DC1 prior to going offline are lost.
Authoritative Restore
The primary purpose of an authoritative restore is to reinstate objects that were deleted from Active Directory. To reinstate
objects that were intentionally or accidentally deleted, a nonauthoritative restore must be completed and followed by an
authoritative restore. Authoritative restore is performed by using Ntdsutil.exe.
The nonauthoritative restore process cannot reinstate deleted objects from a backup image because the backup media that was
used to restore the domain controller contains an image of Active Directory that was created before the objects were deleted. In
this case, the deletions would simply be replicated in from the up‐to‐date replication partner and applied by the restored domain
controller. To reinstate a deleted object, an authoritative restore is required.
The authoritative restore process works as follows:
1. The domain controller is restarted in Directory Services Restore Mode, and a nonauthoritative restore of Active Directory is
performed by using backup media that was created before the object was deleted.
2. Following the nonauthoritative restore but prior to restarting, the object metadata is altered by Ntdsutil.exe so that it has a
higher USN than any other possible version of the object (by default, the version number is increased by 100,000). The effect
is to render the object or objects as authoritative and reinstates them in Active Directory.
The authoritative restore process does not affect objects that were created after the backup was created.
Note
• Only the domain and configuration directory partitions can be marked as authoritative. The schema directory partition cannot
be authoritatively restored.
Notification is enabled on a destination domain controller except under the following conditions, in which the KCC sets the option
NEVER_NOTIFY in repsFrom:
• The connection object that the KCC creates is inbound from a server in a different site. Such a destination is designated as a
bridgehead server for the directory partition. Bridgehead servers pull replication according to a schedule on the site link object.
• The connection object is created to identify the source from which this domain controller replicates to add Active Directory as a
new domain controller.
Urgent Replication
Certain important events trigger replication immediately, overriding existing change notification. Urgent replication is
implemented immediately by using RPC/IP to notify replication partners that changes have occurred on a source domain
controller. Urgent replication uses regular change notification between destination and source domain controller pairs that
otherwise use change notification, but notification is sent immediately in response to urgent events instead of waiting the default
period of 15 seconds (or 300 seconds on domain controllers that are running Windows 2000).
Reapdmin.exe: Repadmin
Category
Windows Server 2003 Support Tools, command‐line tool.
Version compatibility
Repadmin runs on any computer on which Windows Server 2003 Support Tools can be installed, which includes Windows
Server 2003 family and Windows XP Professional.
Repadmin is used to view the replication information on domain controllers. You can determine the last successful replication of
all directory partitions, identify inbound and outbound replication partners, identify the current bridgehead servers, view object
metadata, and generally manage Active Directory replication topology. You can use Repadmin to force replication of an entire
directory partition or of a single object. You can also list domain controllers in a site.
Repadmin is extended in Windows Server 2003 to enable commands to target sets of domain controllers. For example, you can
target all domain controllers in a site or domain, or all domain controllers that are global catalog servers. In Windows 2000 Server,
Repadmin can report information about only one domain‐controller at a time.
Repadmin has also been improved in Windows Server 2003 to include the RemoveLingeringObjects command, which removes
objects that are outdated (do not exist in a replica of the same directory partition on the source domain controller).
Ntdsutil.exe: Ntdsutil
Category
Windows Server 2003 Support Tools, command‐line tool.
Version compatibility
This tool is compatible with Windows Server 2003. An updated version of Ntdsutil is included with Windows Server 2003 Service
Pack 1 (SP1).
Ntdsutil.exe provides management capabilities for Active Directory. You can use Ntdsutil.exe to perform Active Directory database
maintenance, manage and control single‐master operations, and remove replication metadata left behind by domain controllers
that are removed from the network without uninstalling Active Directory. The version of Ntdsutil that is included with
Windows Server 2003 SP1 removes File Replication service (FRS) metadata in addition to Active Directory replication metadata.
You can also use Ntdsutil to create application directory partitions and perform authoritative restore operations. This tool is
intended for use by experienced administrators.
IntersiteFailuresAllowed
Registry path
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters
Version
Windows Server 2003, Windows 2000 Server.
Default value
1.
Number of failed replication attempts prior to excluding nonresponding servers from the intersite topology.
MaxFailureTimeForIntersiteLink (sec)
Registry path
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters
Version
Windows Server 2003, Windows 2000 Server.
Default value
7200 seconds (2 hours).
Time in seconds that must elapse prior to excluding nonresponding servers from the intersite topology.
NonCriticalLinkFailuresAllowed
Registry path
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters
Version
Windows Server 2003, Windows 2000 Server.
Default value
1.
Number of failed replication attempts prior to excluding nonresponding servers from the intrasite topology.
MaxFailureTimeForNonCriticalLink (sec)
Registry path
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters
Version
Windows Server 2003, Windows 2000 Server.
Default value
43200 seconds (12 hours).
Time in seconds that must elapse prior to excluding nonresponding servers from the intrasite topology.
CriticalLinkFailuresAllowed
Registry path
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters
Version
Windows Server 2003, Windows 2000 Server.
Default value
0.
Number of failed replication attempts prior to excluding nonresponding servers for immediate neighbour connections within a
site.
MaxFailureTimeForCriticalLink (sec)
Registry path
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters
Version
Windows Server 2003, Windows 2000 Server.
Default value
7200 seconds (2 hours).
Time in seconds that must elapse prior to excluding nonresponding servers for immediate neighbour connections within a site.
TCP/IP Port
Registry path
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters
Version
Windows Server 2003, Windows 2000 Server.
Default value
135.
TCP port that the directory service uses instead of using dynamic port 135. The domain controller must be restarted before the
change takes effect.
Account Lockout Policy: Changes to these settings in the Domain Security Policy trigger urgent
• Account lockout duration replication.
Password Policy: Changes to these settings in the Domain Security Policy trigger urgent
• Enforce password history replication.
Contact PDC on logon failure Account lockout and domain password changes rely on contacting the primary
domain controller (PDC) emulator urgently to update the PDC emulator with the
change. If Contact PDC on logon failure is disabled, replication of password
changes to the PDC emulator occurs non‐urgently.