Modifying Replication Schedules

Modifying Replication Schedules


You want to change the times of day or week that a particular site link (IP or SMTP) is available for replication.


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

  2. In the left pane, expand Sites Inter-Site Transports.

  3. Click either the IP or SMTP folder, depending where the site link is stored.

  4. In the right pane, double-click on the link you want to modify.

  5. On the General tab, click Change Schedule.

  6. Click OK.

  7. Select the times and days of the week that you wish to allow or disallow, and select the Replication Available or Replication Not Available radio button, as appropriate.

  8. Click OK twice to save your changes.

Using a command-line interface

To configure a site link to be available 24 hours a day,7 days a week, use the following syntax:

	> admod b cn=<SiteLinkName>,cn=<TransportName>,cn=Inter-site
	Transports,cn=sites,cn=configuration,<ForestRootDN> schedule::0

Using VBScript
	' The following script will display the availability schedule
	' for a particular site link.

	Days = Array _
	    ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")

	Set objSiteLink = GetObject _
	arrHours = objSiteLink.Get("schedule")

	For i = 1 To LenB(arrHours)
	    arrHoursBytes(i-1) = AscB(MidB(arrHours, i, 1))
	    WScript.Echo "MidB returns: " & MidB(arrHours, i, 1)
	    WScript.Echo "arrHoursBytes: " & arrHoursBytes(i-1)
	    wscript.echo vbcrlf

	intCounter = 0

	intLoopCounter = 0
	WScript.echo "Day Byte 1 Byte 2 Byte 3"
	For Each HourByte In arrHoursBytes
	    arrHourBits = DisplayLogonHourBits(HourByte)

	    If intCounter = 0 Then
	        WScript.STDOUT.Write Days(intLoopCounter) & Space(2)
	        intLoopCounter = intLoopCounter + 1
	    End If

	    For Each HourBit In arrHourBits
	        WScript.STDOUT.Write HourBit
	        intCounter = 1 + intCounter

	        If intCounter = 8 or intCounter = 16 Then
	            Wscript.STDOUT.Write Space(1)
	        End If

	        If intCounter = 24 Then
	            WScript.echo vbCr
	            intCounter = 0
	        End If

	Function DisplayLogonHourBits(x)
	    Dim arrBits(7)
	    For i = 7 to 0 Step -1
	        If x And 2^i Then
	            arrBits(i) = 1
	            arrBits(i) = 0
	        End If
	    DisplayLogonHourBits = arrBits
	End Function


When you configure an inter-site replication link, you can specify a particular schedule during which the link will be available for replication. By default, inter-site links can pass replication traffic 24 hours a day,7 days a week, but you can restrict this so that it is only available for specific hours of the day and/or days of the week. This might be useful for a heavily utilized link that you do not want to have overloaded with replication traffic. For example, a bank headquarters may wish to stop replication traffic during a two-hour time period at the end of every day while its branch offices are transmitting daily report information.

Using VBScript

The schedule attribute of a siteLink object is a binary object, rather than a simple string like most of the other attributes we've discussed. Because of this, manipulating it directly is a bit trickier than simply inserting a new string in place of an old one. In the VBScript example shown in this recipe, we use a VBScript function that manipulates the various bits of the attribute to display the correct values.

See Also

Recipe 13.4 to force replication from one DC to another, MS KB 232263 (Replication Schedule for Intrasite Replication Partners), and MSDN: schedule attribute [AD Schema]

 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows