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.
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
' 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 _ ("LDAP://<SiteLinkDN>") 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 Next 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 Next Next Function DisplayLogonHourBits(x) Dim arrBits(7) For i = 7 to 0 Step -1 If x And 2^i Then arrBits(i) = 1 Else arrBits(i) = 0 End If Next 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.
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.