Skip to Content
Active Directory Cookbook
book

Active Directory Cookbook

by Robbie Allen
September 2003
Intermediate to advanced
624 pages
15h 49m
English
O'Reilly Media, Inc.
Content preview from Active Directory Cookbook

12.4. Forcing Replication from One Domain Controller to Another

Problem

You want to force replication between two partners.

Solution

Using a graphical user interface

  1. Open the Active Directory Sites and Services snap-in.

  2. Browse to the NTDS Setting object for the domain controller you want to replicate to.

  3. In the right pane, right-click on the connection object to the domain controller you want to replicate from and select Replicate Now.

Using a command-line interface

The following command will perform a replication sync of the naming context specified by <NamingContextDN> from <DC2Name> to <DC1Name>:

> repadmin /replicate <DC1Name> <DC2Name> <NamingContextDN>

The Windows 2000 version of repadmin has a different syntax to accomplish the same thing. Here is the equivalent syntax:

> repadmin /sync <NamingContextDN> <DC1Name> <DC2GUID>

Using VBScript

' This code initiates a replication event between two DCs
' for a naming context
' ------ SCRIPT CONFIGURATION ------
strDC1Name = "<DC1Name>"   ' e.g. dc1 
strDC2Name = "<DC2Name>"   ' e.g. dc2
strNamingContextDN = "<NamingContextDN>"  ' e.g. dc=rallencorp,dc=com
' ------ END CONFIGURATION ---------

set objIadsTools = CreateObject("IADsTools.DCFunctions")
intRes = objIadsTools.ReplicaSync(Cstr(strDC1Name),_
                                  Cstr(strNamingContextDN),_ 
                                  Cstr(strDC2Name), 0, 0)
if intRes = -1 then
   Wscript.Echo "Error: " & objIadsTools.LastErrorText
else
   WScript.Echo "Replication intitiated from " & strDC2Name & _
                " to " & strDC1Name
end if

Discussion

Each solution shows how ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Active Directory Administration Cookbook

Active Directory Administration Cookbook

Sander Berkouwer
Active Directory Cookbook, 3rd Edition

Active Directory Cookbook, 3rd Edition

Laura E. Hunter, Robbie Allen
Active Directory, Second Edition

Active Directory, Second Edition

Robbie Allen, Alistair G. Lowe-Norris

Publisher Resources

ISBN: 0596004648Catalog PageErrata