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.

217 lines
6.3 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. $Nt4Acct = "frs1221\\$b\$";
  24. BCH: FRS_SERVER (/RP="D:\RSB" /SP="D:\staging"
  25. /COMPUTER=$Nt4Acct
  26. /id="-$b"
  27. /DNS_NAME="$b.frs1221.nttest.microsoft.com"
  28. )
  29. }
  30. #
  31. #
  32. #for $b (0 .. 20) {
  33. #
  34. # $bchname = "Branch-$b";
  35. #
  36. # BCH: FRS_SERVER (/RP="D:\RSB" /SP="D:\staging"
  37. # /COMPUTER="$bchname/hubsite/servers/" /id="-$b"
  38. # /NAME="$bchname.hubsite.ajax.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. PRIMARY_SCH: FRS_SCHEDULE (/REPL_INTERVAL=4 /REPL_DURATION="1:30"
  47. /TIME_ZONE="+1" /REPL_OFFSET=0 /STAGGER=2
  48. /METHOD=1 /NAME='Primary Sched'
  49. /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"
  50. )
  51. #
  52. # The following function creates the connection objects for a hub spoke topology.
  53. #
  54. FRS_SUB CREATE_HUB_SPOKE_CONN(/HUBSET=SET_REF_SET # Hubs
  55. /BCHSET=SET_REF_SET # Branches
  56. /SC1=SCHEDULE )
  57. $Hx = 0;
  58. $NHub = FRS_COUNT_SET(/SET=%HUBSET%);
  59. print " NHUB = $NHub\n\n";
  60. #
  61. # RESTRICTION: don't PUT FRS FUNCTION REFS INSIDE A QUOTED STRING.
  62. #
  63. print " NBCH FRS _COUNT_SET( /SET= % BCHSET % ) ", FRS_COUNT_SET(/SET= %BCHSET% ), "\n" ;
  64. #
  65. # Create the topology
  66. #
  67. foreach $bch (FRS_ARRAY(/SET=%BCHSET%)) {
  68. print "working on branch: $bch->{ONAME}\n";
  69. $hubsrv = %HUBSET%[$Hx];
  70. #
  71. # RESTRICTION: need braces around ONAME and MNAME.
  72. #
  73. FRS_CONNECTION (/TO=$bch /FROM=%HUBSET%[$Hx] /SCHED=%SC1%
  74. /ONAME="FROM-".$hubsrv->{MNAME}."-TO-".$bch->{ONAME} )
  75. FRS_CONNECTION (/TO=%HUBSET%[$Hx] /FROM=$bch /SCHED=%SC1%
  76. /ONAME="FROM-".$bch->{ONAME}."-TO-".$hubsrv->{MNAME} )
  77. $Hx=($Hx+1) % $NHub;
  78. if ($Hx == 0) {
  79. FRS_STAGGER (/SCHED=%SC1%)
  80. }
  81. }
  82. FRS_END_SUB
  83. #
  84. # The following function creates the connection objects for a ring topology.
  85. #
  86. FRS_SUB CREATE_RING_CONN(/HUBSET=SET_REF_SET )
  87. FRS_SHOW(/SET=%HUBSET%)
  88. $Ringx = 0;
  89. $RingCount = FRS_COUNT_SET(/SET=%HUBSET%);
  90. print " RingCount = $RingCount\n\n";
  91. #
  92. # Create the topology
  93. #
  94. for ($Ringx=0; $Ringx < $RingCount-1; $Ringx++) {
  95. $RM1 = %HUBSET%[$Ringx];
  96. $RM2 = %HUBSET%[($Ringx+1) % $RingCount];
  97. #
  98. # RESTRICTION: need braces around ONAME and MNAME.
  99. #
  100. FRS_CONNECTION (/TO=$RM1 /FROM=$RM2 /SCHED=ON
  101. /ONAME="FROM-".$RM2->{MNAME}."-TO-".$RM1->{MNAME} )
  102. FRS_CONNECTION (/TO=$RM2 /FROM=$RM1 /SCHED=ON
  103. /ONAME="FROM-".$RM1->{MNAME}."-TO-".$RM2->{MNAME} )
  104. }
  105. FRS_END_SUB
  106. #
  107. # The following function builds the member objects for a hub spoke topology
  108. # and creates the connection objects.
  109. #
  110. FRS_SUB CREATE_HUB_SPOKE(/HUBSET=SET_REF_SET # Hubs
  111. /BCHSET=SET_REF_SET # branches
  112. /SC1=SCHEDULE
  113. /REPSETDN=SET_ELEMENT)
  114. FRSSUP::PrintHash(\%__args);
  115. FRS_SHOW(/SET=%HUBSET%)
  116. #
  117. # Create the hub member objects
  118. #
  119. # Restriction: All subroutine argument refs are surrounded by "%".
  120. # References to parameters in other objects use the
  121. # notation "->{...}". e.g. COMPUTER, MNAME, id
  122. #
  123. foreach $hub (FRS_ARRAY(/SET=%HUBSET%)) {
  124. MOBJHUB: FRS_MEMBER (/UNDER=%REPSETDN%
  125. /SERVER=$hub
  126. /COMPUTER=$hub->{COMPUTER}
  127. /ONAME=$hub->{MNAME} )
  128. }
  129. #
  130. # create the branch member objects.
  131. #
  132. foreach $bch (FRS_SET(/SET=%BCHSET%)) {
  133. MOBJBCH: FRS_MEMBER (/UNDER=%REPSETDN%
  134. /SERVER=$bch
  135. /COMPUTER=$bch->{COMPUTER}
  136. /ONAME="B".$bch->{id} )
  137. }
  138. CREATE_RING_CONN(/HUBSET=<MOBJHUB> )
  139. CREATE_HUB_SPOKE_CONN(/HUBSET=<MOBJHUB> # Hubs
  140. /BCHSET=<MOBJBCH> # Branches
  141. /SC1=%SC1% )
  142. FRS_END_SUB
  143. #
  144. # Create the replica set under the FRS Settings object.
  145. #
  146. SETTINGS: FRS_SETTINGS (/DN="cn=services,cn=configuration,dc=frs1221,dc=nttest,dc=microsoft,dc=com"
  147. /ONAME="cn=ntfrs test settings")
  148. SET: FRS_REPLICASET (/UNDER=<SETTINGS> /TYPE=DFS /ONAME="HubSpokeRepSet")
  149. CREATE_HUB_SPOKE(/HUBSET=<HUB> # Hubs
  150. /BCHSET=<BCH> # backup hub
  151. /SC1=<PRIMARY_SCH>
  152. /REPSETDN=<SET>)