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.

108 lines
4.4 KiB

  1. ## Command line defined variables.
  2. ## Command line defined parameters.
  3. use frsobjsup;
  4. package main;
  5. my ($__HashRef, $__k, $__v);
  6. my (%CMD_VARS, %CMD_PARS);
  7. &FRSSUP::ProcessCmdLine(\%CMD_VARS, \%CMD_PARS);
  8. my $Usage = "
  9. Specific Usage: perl $0 [cmd options] \> output
  10. Process the erac.mrs configuration script.
  11. Command line options must be prefixed with a dash.
  12. The required input options to this script are:
  13. -DBchID=nnnnn : to provide a value for the Bch ID parameter.
  14. -DHubID=nnnnn : to provide a value for the Hub ID parameter.
  15. ";
  16. FRSSUP::CheckForHelp(\%CMD_PARS, \$Usage);
  17. FRSSUP::ShowHelp("ERROR - Required parameter BchID not found.", \$Usage) if (!exists $CMD_VARS{"BchID"});
  18. push @bchID, $CMD_VARS{"BchID"};
  19. FRSSUP::ShowHelp("ERROR - Required parameter HubID not found.", \$Usage) if (!exists $CMD_VARS{"HubID"});
  20. push @hubID, $CMD_VARS{"HubID"};
  21. push @bchTimeZone, 0;
  22. $domain = "na";
  23. sub CREATE_WORK_RS {
  24. my %__args = (@_);
  25. my ($__HashRef, $__k, $__v);
  26. # Restriction: All subroutine argument refs are surrounded by "%"
  27. # notation "->{...}"
  28. $__HashRef = FRS_REPLICASET->New(
  29. UNDER=>$__args{SETTINGSDN}, TYPE=>DFS, ONAME=>$__args{B}->{rep_set_name}
  30. );
  31. &FRSSUP::AddToSet("SET", $__HashRef);
  32. # root path could be changed by adding "/RP="newroot""
  33. # surrounded by angle brackets. So "&FRSSUP::SelectSet(SET)"
  34. $__HashRef = FRS_MEMBER->New(
  35. UNDER=>&FRSSUP::SelectSet(SET)->[0], SERVER=>$__args{HA}, COMPUTER=>$__args{HA}->{COMPUTER}, ONAME=>"ComputerObjectGuid", MAKE_PRIMARY_MEMBER=>TRUE
  36. );
  37. &FRSSUP::AddToSet("MHA", $__HashRef);
  38. $__HashRef = FRS_MEMBER->New(
  39. UNDER=>&FRSSUP::SelectSet(SET)->[0], SERVER=>$__args{B}, COMPUTER=>$__args{B}->{COMPUTER}, ONAME=>"ComputerObjectGuid"
  40. );
  41. &FRSSUP::AddToSet("MB", $__HashRef);
  42. FRS_CONNECTION->New(
  43. TO=>&FRSSUP::SelectSet(MB)->[0], FROM=>&FRSSUP::SelectSet(MHA)->[0], SCHED=>$__args{SC1}, ONAME=>"FROM-".$__args{HA}->{ONAME}."-TO-".$__args{B}->{ONAME}
  44. );
  45. FRS_CONNECTION->New(
  46. TO=>&FRSSUP::SelectSet(MHA)->[0], FROM=>&FRSSUP::SelectSet(MB)->[0], SCHED=>$__args{SC1}, ONAME=>"FROM-".$__args{B}->{ONAME}."-TO-".$__args{HA}->{ONAME}
  47. );
  48. &FRSSUP::DeleteSet("SET");
  49. &FRSSUP::DeleteSet("MHA");
  50. &FRSSUP::DeleteSet("MB");
  51. } # FRS_END_SUB
  52. for ($ib=0; $ib<scalar(@bchID); $ib++) {
  53. # The branch name ($bchName) is a concatenation (use of "."
  54. # The hub root path uses the branch name (no "."
  55. $bchName = $bchID[$ib] . "-I01";
  56. $bchNt4Acct = "$domain\\$bchName\$";
  57. $hubName = "STL-FSNA-I" . $hubID[$ib];
  58. $hubRootPath = "C:\\BRANCHES\\$bchName";
  59. $hubNt4Acct = "$domain\\$hubName\$";
  60. $__HashRef = FRS_SERVER->New(
  61. RP=>$hubRootPath, SP=>"C:\\FRS-STAGING", COMPUTER=>$hubNt4Acct, ONAME=>$hubName, DNS_NAME=>"$hubName.$domain.erac.com"
  62. );
  63. &FRSSUP::AddToSet("HUB", $__HashRef);
  64. $__HashRef = FRS_SERVER->New(
  65. RP=>"D:\\USERS", SP=>"C:\\FRS-STAGING", COMPUTER=>$bchNt4Acct, ONAME=>$bchName, time_zone=>$bchTimeZone[$ib], DNS_NAME=>"$bchName.$domain.erac.com", rep_set_name=>"dfsroot|$bchName"
  66. );
  67. &FRSSUP::AddToSet("BCH", $__HashRef);
  68. }
  69. $__HashRef = FRS_SCHEDULE->New(
  70. REPL_INTERVAL=>24, REPL_DURATION=>"2:00", TIME_ZONE=>"-6:00", REPL_OFFSET=>"18:00", STAGGER=>"0:15", METHOD=>1, NAME=>'Primary Sched', DISABLE=>"su:05:00-su:18:00,mo:05:00-mo:18:00,tu:05:00-tu:18:00,we:05:00-we:18:00,th:05:00-th:18:00,fr:05:00-fr:18:00,sa:05:00-sa:18:00"
  71. );
  72. &FRSSUP::AddToSet("PRIMARY_SCH", $__HashRef);
  73. $__HashRef = FRS_SCHEDULE->New(
  74. OVERRIDE=>"su:00-sa:23:45", METHOD=>2
  75. );
  76. &FRSSUP::AddToSet("ON_SCHED", $__HashRef);
  77. $__HashRef = FRS_SETTINGS->New(
  78. DN=>"cn=dfs volumes,cn=file replication service,cn=system,dc=na,dc=erac,dc=com", ONAME=>"cn=dfsroot"
  79. );
  80. &FRSSUP::AddToSet("SETTINGS", $__HashRef);
  81. for ($ib=0; $ib<scalar(@bchID); $ib++) {
  82. # a single item from the "HUB"
  83. &CREATE_WORK_RS (
  84. HA=>&FRSSUP::SelectSet(HUB)->[$ib], B=>&FRSSUP::SelectSet(BCH)->[$ib], SC1=>&FRSSUP::SelectSet(ON_SCHED)->[0], SETTINGSDN=>&FRSSUP::SelectSet(SETTINGS)->[0] );
  85. FRS_SCHEDULE::FRS_STAGGER(
  86. SCHED=>&FRSSUP::SelectSet(PRIMARY_SCH)->[0] );
  87. }
  88. __END__