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.

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