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.

137 lines
5.1 KiB

  1. use frsobjsup;
  2. package main;
  3. my ($__HashRef, $__k, $__v);
  4. $stage = "D:\\staging";
  5. $DC_OU_DN = "ou=domain controllers,dc=frs1221,dc=nttest,dc=microsoft,dc=com";
  6. $__HashRef = FRS_SERVER->New(
  7. RP=>"E:\\RSB", SP=>"$stage", COMPUTER=>'frs1221\\sudarctest1$', DNS_NAME=>"sudarctest1.frs1221.nttest.microsoft.com"
  8. );
  9. &FRSSUP::AddToSet("HUB", $__HashRef);
  10. $__HashRef = FRS_SERVER->New(
  11. RP=>"E:\\RSB", SP=>"$stage", COMPUTER=>'frs1221\\sudarctest2$', DNS_NAME=>"sudarctest2.frs1221.nttest.microsoft.com"
  12. );
  13. &FRSSUP::AddToSet("HUB", $__HashRef);
  14. $__HashRef = FRS_SERVER->New(
  15. RP=>"E:\\RSB", SP=>"$stage", COMPUTER=>'frs1221\\sudarctest3$', DNS_NAME=>"sudarctest3.frs1221.nttest.microsoft.com"
  16. );
  17. &FRSSUP::AddToSet("HUB", $__HashRef);
  18. foreach $b ("sudarctest4", "DREWSAM-SRV" ) {
  19. $Nt4Acct = "frs1221\\$b\$";
  20. $__HashRef = FRS_SERVER->New(
  21. RP=>"D:\\RSB", SP=>"D:\\staging", COMPUTER=>$Nt4Acct, id=>"-$b", DNS_NAME=>"$b.frs1221.nttest.microsoft.com", rep_set_name=>"WD-$b"
  22. );
  23. &FRSSUP::AddToSet("BCH", $__HashRef);
  24. }
  25. $__HashRef = FRS_SCHEDULE->New(
  26. REPL_INTERVAL=>04, REPL_DURATION=>"1:45", TIME_ZONE=>-1, REPL_OFFSET=>0, STAGGER=>02, METHOD=>1, TYPE=>0, NAME=>'Primary Sched', 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", OVERRIDE=>"we:12:00-th:07:30"
  27. );
  28. &FRSSUP::AddToSet("PRIMARY_SCH", $__HashRef);
  29. $__HashRef = FRS_SCHEDULE->New(
  30. REPL_INTERVAL=>04, REPL_DURATION=>"0:45", TIME_ZONE=>"+1:30", REPL_OFFSET=>02, STAGGER=>02, METHOD=>1, TYPE=>0, NAME=>'Backup Sched', OVERRIDE=>"we:12:00-th:07:30"
  31. );
  32. &FRSSUP::AddToSet("BACKUP_SCH", $__HashRef);
  33. sub CREATE_WORK_RS {
  34. my %__args = (@_);
  35. my ($__HashRef, $__k, $__v);
  36. while ( ($__k, $__v) = each %__args ) { print "\t$__k => '$__v'\n"; }
  37. # Restriction: All subroutine argument refs are surrounded by "%"
  38. # notation "->{...}"
  39. $__HashRef = FRS_REPLICASET->New(
  40. UNDER=>$__args{SETTINGSDN}, TYPE=>DFS, ONAME=>$__args{B}->{rep_set_name}
  41. );
  42. &FRSSUP::AddToSet("SET", $__HashRef);
  43. # The Root path on MHA is a concatenation (use of "."
  44. # surrounded by angle brackets. So "&FRSSUP::SelectSet(SET)"
  45. $__HashRef = FRS_MEMBER->New(
  46. UNDER=>&FRSSUP::SelectSet(SET)->[0], SERVER=>$__args{HA}, COMPUTER=>$__args{HA}->{COMPUTER}, ONAME=>"Primary Hub", RP=>$__args{HA}->{RP}.$__args{B}->{id}
  47. );
  48. &FRSSUP::AddToSet("MHA", $__HashRef);
  49. $__HashRef = FRS_MEMBER->New(
  50. UNDER=>&FRSSUP::SelectSet(SET)->[0], SERVER=>$__args{HB}, COMPUTER=>$__args{HB}->{COMPUTER}, ONAME=>"Backup Hub", RP=>$__args{HA}->{RP}.$__args{B}->{id}
  51. );
  52. &FRSSUP::AddToSet("MHB", $__HashRef);
  53. $__HashRef = FRS_MEMBER->New(
  54. UNDER=>&FRSSUP::SelectSet(SET)->[0], SERVER=>$__args{B}, COMPUTER=>$__args{B}->{COMPUTER}, ONAME=>"Branch"
  55. );
  56. &FRSSUP::AddToSet("MB", $__HashRef);
  57. FRS_CONNECTION->New(
  58. BINDDC=>SUDARCTEST1, TO=>&FRSSUP::SelectSet(MB)->[0], FROM=>&FRSSUP::SelectSet(MHA)->[0], ONAME=>"FROM-PRIMARY-HUB", SCHED=>$__args{SC1}
  59. );
  60. FRS_CONNECTION->New(
  61. TO=>&FRSSUP::SelectSet(MB)->[0], FROM=>&FRSSUP::SelectSet(MHB)->[0], ONAME=>"FROM-BACKUP-HUB", SCHED=>$__args{SC2}
  62. );
  63. FRS_CONNECTION->New(
  64. TO=>&FRSSUP::SelectSet(MHA)->[0], FROM=>&FRSSUP::SelectSet(MB)->[0], ONAME=>"FROM-BRANCH-PRIMARY", SCHED=>$__args{SC1}
  65. );
  66. FRS_CONNECTION->New(
  67. TO=>&FRSSUP::SelectSet(MHB)->[0], FROM=>&FRSSUP::SelectSet(MB)->[0], ONAME=>"FROM-BRANCH-BACKUP", SCHED=>$__args{SC2}
  68. );
  69. FRS_CONNECTION->New(
  70. TO=>&FRSSUP::SelectSet(MHA)->[0], FROM=>&FRSSUP::SelectSet(MHB)->[0], ONAME=>"INTER-HUB1", SCHED=>ON
  71. );
  72. FRS_CONNECTION->New(
  73. TO=>&FRSSUP::SelectSet(MHB)->[0], FROM=>&FRSSUP::SelectSet(MHA)->[0], ONAME=>"INTER-HUB2", SCHED=>ON
  74. );
  75. &FRSSUP::DeleteSet("SET");
  76. &FRSSUP::DeleteSet("MHA");
  77. &FRSSUP::DeleteSet("MHB");
  78. &FRSSUP::DeleteSet("MB");
  79. } # FRS_END_SUB
  80. $Hx = 0;
  81. $NHub = scalar @{
  82. &FRSSUP::SelectSet(HUB) }
  83. ;
  84. print " NHUB = $NHub\n\n";
  85. $__HashRef = FRS_SETTINGS->New(
  86. DN=>"cn=services,cn=configuration,dc=frs1221,dc=nttest,dc=microsoft,dc=com", ONAME=>"cn=ntfrs test settings"
  87. );
  88. &FRSSUP::AddToSet("SETTINGS", $__HashRef);
  89. foreach $Branch ( @{
  90. &FRSSUP::SelectSet(BCH) }
  91. ) {
  92. # a single item from the "HUB"
  93. &CREATE_WORK_RS (
  94. HA=>&FRSSUP::SelectSet(HUB)->[$Hx], HB=>&FRSSUP::SelectSet(HUB)->[($Hx+1) % $NHub], B=>$Branch, SC1=>&FRSSUP::SelectSet(PRIMARY_SCH)->[0], SC2=>&FRSSUP::SelectSet(BACKUP_SCH)->[0], SETTINGSDN=>&FRSSUP::SelectSet(SETTINGS)->[0] );
  95. $Hx=($Hx+1) % $NHub;
  96. # If we have completed a sweep through all servers in the "HUB"
  97. if ($Hx == 0) {
  98. FRS_SCHEDULE::FRS_STAGGER(
  99. SCHED=>&FRSSUP::SelectSet(PRIMARY_SCH)->[0] );
  100. FRS_SCHEDULE::FRS_STAGGER(
  101. SCHED=>&FRSSUP::SelectSet(BACKUP_SCH)->[0] );
  102. }
  103. }
  104. __END__