Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

229 lines
7.0 KiB

  1. use Time::Local;
  2. printf "Configuration generated at %s\n\n", scalar localtime;
  3. $stage = "D:\\staging"; ## NOTE: double slash needed when variable is used.
  4. $DC_OU_DN = "ou=domain controllers,dc=frs1221,dc=nttest,dc=microsoft,dc=com";
  5. #
  6. # The server table
  7. #
  8. HUB: FRS_SERVER (/RP="E:\RSB" /SP="$stage" /COMPUTER='frs1221\sudarctest1$' ## note use of single quote because of $
  9. /DNS_NAME="sudarctest1.frs1221.nttest.microsoft.com" /MNAME="hub0")
  10. HUB: FRS_SERVER (/RP="E:\RSB" /SP="$stage" /COMPUTER='frs1221\sudarctest2$'
  11. /DNS_NAME="sudarctest2.frs1221.nttest.microsoft.com" /MNAME="hub1")
  12. #
  13. #HUB: FRS_SERVER (/RP="E:\RSB" /SP="$stage" /COMPUTER='frs1221\sudarctest3$'
  14. # /DNS_NAME="sudarctest3.frs1221.nttest.microsoft.com" /MNAME="hub2")
  15. #
  16. #HUB: FRS_SERVER (/RP="E:\RSB" /SP="$stage" /COMPUTER='frs1221\sudarctest1$'
  17. # /DNS_NAME="sudarctest1.frs1221.nttest.microsoft.com" /MNAME="hub3")
  18. #
  19. #HUB: FRS_SERVER (/RP="E:\RSB" /SP="$stage" /COMPUTER='frs1221\sudarctest1$'
  20. # /DNS_NAME="sudarctest1.frs1221.nttest.microsoft.com" /MNAME="hub4")
  21. #
  22. #foreach $b ("sudarctest4", "DREWSAM-SRV", "sudarctest3", "DREWSAM-SRV" ) {
  23. #
  24. # $Nt4Acct = "frs1221\\$b\$";
  25. #
  26. # BCH: FRS_SERVER (/RP="D:\RSB" /SP="D:\staging"
  27. # /COMPUTER=$Nt4Acct
  28. # /id="-$b"
  29. # /DNS_NAME="$b.frs1221.nttest.microsoft.com"
  30. # )
  31. #}
  32. for $b (0 .. 200) {
  33. $bchname = "Branch-$b";
  34. $Nt4Acct = "frs1221\\$b\$";
  35. BCH: FRS_SERVER (/RP="D:\RSB" /SP="D:\staging"
  36. /COMPUTER=$Nt4Acct
  37. /id="-$b"
  38. /DNS_NAME="$bchname.frs1221.nttest.microsoft.com" )
  39. }
  40. # The FRS_SCHEDULE command does not actually create any FRS objects in the DS,
  41. # rather it defines the parameters to use when creating a schedule.
  42. #
  43. # Restriction: Any time with a ":" must be enclosed in quotes. See /REPL_DURATION,
  44. # /TIME_ZONE and /DISABLE below.
  45. #
  46. # This schedule replicates for 1.5 hours every 4 hours. Each time the schedule is
  47. # updated by FRS_STAGGER it is advanced by 15 min. So it repeats every 16 updates
  48. # which is the 4 hour period divided by the 15min stagger adjustment. In the case
  49. # of 200 branches, and two hubs at most 7 branches will start replication in any
  50. # single 15 min period. Since the duration is 1.5 hours then at most 42 branches
  51. # (6 * 7) will be replicating in any given 15 min period.
  52. #
  53. # The blackout period is mon thru fri from 7:30 AM to 6PM.
  54. # The time zone is GMT-5:00 hours or Eastern US Time.
  55. #
  56. PRIMARY_SCH: FRS_SCHEDULE (/REPL_INTERVAL=4 /REPL_DURATION="1:30"
  57. /TIME_ZONE="-5:00" /REPL_OFFSET=0 /STAGGER="0:15"
  58. /METHOD=1 /NAME='Primary Sched'
  59. /DISABLE="mo:07:30-mo:18:00,tu:07:30-tu:18:00,we:07:30-we:18:00,th:07:30-th:18:00,fr:07:30-fr:18:00"
  60. )
  61. #
  62. # The following function creates the connection objects for a hub spoke topology.
  63. #
  64. FRS_SUB CREATE_HUB_SPOKE_CONN(/HUBSET=SET_REF_SET # Hubs
  65. /BCHSET=SET_REF_SET # Branches
  66. /SC1=SCHEDULE )
  67. $Hx = 0;
  68. $NHub = FRS_COUNT_SET(/SET=%HUBSET%);
  69. print " NHUB = $NHub\n\n";
  70. #
  71. # RESTRICTION: don't PUT FRS FUNCTION REFS INSIDE A QUOTED STRING.
  72. #
  73. print " NBCH FRS _COUNT_SET( /SET= % BCHSET % ) ", FRS_COUNT_SET(/SET= %BCHSET% ), "\n" ;
  74. #
  75. # Create the topology
  76. #
  77. foreach $bch (FRS_ARRAY(/SET=%BCHSET%)) {
  78. print "working on branch: $bch->{ONAME}\n";
  79. $hubsrv = %HUBSET%[$Hx];
  80. #
  81. # RESTRICTION: need braces around ONAME and MNAME.
  82. #
  83. FRS_CONNECTION (/TO=$bch /FROM=%HUBSET%[$Hx] /SCHED=%SC1%
  84. /ONAME="FROM-".$hubsrv->{MNAME}."-TO-".$bch->{ONAME} )
  85. FRS_CONNECTION (/TO=%HUBSET%[$Hx] /FROM=$bch /SCHED=%SC1%
  86. /ONAME="FROM-".$bch->{ONAME}."-TO-".$hubsrv->{MNAME} )
  87. $Hx=($Hx+1) % $NHub;
  88. if ($Hx == 0) {
  89. FRS_STAGGER (/SCHED=%SC1%)
  90. }
  91. }
  92. FRS_END_SUB
  93. #
  94. # The following function creates the connection objects for a ring topology.
  95. #
  96. FRS_SUB CREATE_RING_CONN(/HUBSET=SET_REF_SET )
  97. FRS_SHOW(/SET=%HUBSET%)
  98. $Ringx = 0;
  99. $RingCount = FRS_COUNT_SET(/SET=%HUBSET%);
  100. print " RingCount = $RingCount\n\n";
  101. #
  102. # Create the topology
  103. #
  104. for ($Ringx=0; $Ringx < $RingCount-1; $Ringx++) {
  105. $RM1 = %HUBSET%[$Ringx];
  106. $RM2 = %HUBSET%[($Ringx+1) % $RingCount];
  107. #
  108. # RESTRICTION: need braces around ONAME and MNAME.
  109. #
  110. FRS_CONNECTION (/TO=$RM1 /FROM=$RM2 /SCHED=ON
  111. /ONAME="FROM-".$RM2->{MNAME}."-TO-".$RM1->{MNAME} )
  112. FRS_CONNECTION (/TO=$RM2 /FROM=$RM1 /SCHED=ON
  113. /ONAME="FROM-".$RM1->{MNAME}."-TO-".$RM2->{MNAME} )
  114. }
  115. FRS_END_SUB
  116. #
  117. # The following function builds the member objects for a hub spoke topology
  118. # and creates the connection objects.
  119. #
  120. FRS_SUB CREATE_HUB_SPOKE(/HUBSET=SET_REF_SET # Hubs
  121. /BCHSET=SET_REF_SET # branches
  122. /SC1=SCHEDULE
  123. /REPSETDN=SET_ELEMENT)
  124. FRSSUP::PrintHash(\%__args);
  125. FRS_SHOW(/SET=%HUBSET%)
  126. #
  127. # Create the hub member objects
  128. #
  129. # Restriction: All subroutine argument refs are surrounded by "%".
  130. # References to parameters in other objects use the
  131. # notation "->{...}". e.g. COMPUTER, MNAME, id
  132. #
  133. foreach $hub (FRS_ARRAY(/SET=%HUBSET%)) {
  134. MOBJHUB: FRS_MEMBER (/UNDER=%REPSETDN%
  135. /SERVER=$hub
  136. /COMPUTER=$hub->{COMPUTER}
  137. /ONAME=$hub->{MNAME} )
  138. }
  139. #
  140. # create the branch member objects.
  141. #
  142. foreach $bch (FRS_SET(/SET=%BCHSET%)) {
  143. MOBJBCH: FRS_MEMBER (/UNDER=%REPSETDN%
  144. /SERVER=$bch
  145. /COMPUTER=$bch->{COMPUTER}
  146. /ONAME="B".$bch->{id} )
  147. }
  148. CREATE_RING_CONN(/HUBSET=<MOBJHUB> )
  149. CREATE_HUB_SPOKE_CONN(/HUBSET=<MOBJHUB> # Hubs
  150. /BCHSET=<MOBJBCH> # Branches
  151. /SC1=%SC1% )
  152. FRS_END_SUB
  153. #
  154. # Create the replica set under the FRS Settings object.
  155. #
  156. SETTINGS: FRS_SETTINGS (/DN="cn=services,cn=configuration,dc=frs1221,dc=nttest,dc=microsoft,dc=com"
  157. /ONAME="cn=ntfrs test settings")
  158. SET: FRS_REPLICASET (/UNDER=<SETTINGS> /TYPE=DFS /ONAME="HubSpokeRepSet")
  159. CREATE_HUB_SPOKE(/HUBSET=<HUB> # Hubs
  160. /BCHSET=<BCH> # backup hub
  161. /SC1=<PRIMARY_SCH>
  162. /REPSETDN=<SET>)