Source code of Windows XP (NT5)
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.

218 lines
7.0 KiB

  1. Option Explicit
  2. '----------------------------------------------------------------------------
  3. ' ADMT Scripting Constants
  4. '----------------------------------------------------------------------------
  5. ' RenameOption constants
  6. Const admtDoNotRename = 0
  7. Const admtRenameWithPrefix = 1
  8. Const admtRenameWithSuffix = 2
  9. ' PasswordOption constants
  10. Const admtPasswordFromName = 0
  11. Const admtComplexPassword = 1
  12. ' ConflictOptions constants
  13. Const admtIgnoreConflicting = &H0000
  14. Const admtReplaceConflicting = &H0001
  15. Const admtRenameConflictingWithPrefix = &H0002
  16. Const admtRenameConflictingWithSuffix = &H0003
  17. Const admtRemoveExistingUserRights = &H0010
  18. Const admtRemoveExistingMembers = &H0020
  19. ' DisableOption constants
  20. Const admtDisableNeither = 0
  21. Const admtDisableSource = 1
  22. Const admtDisableTarget = 2
  23. ' SourceExpiration constant
  24. Const admtNoExpiration = -1
  25. ' Translation Option
  26. Const admtTranslateReplace = 0
  27. Const admtTranslateAdd = 1
  28. Const admtTranslateRemove = 2
  29. ' AddOption constants
  30. Const admtData = 0
  31. Const admtFile = 1
  32. Const admtDomain = 2
  33. Const admtRecurse = &H0100
  34. Const admtFlattenHierarchy = &H0000
  35. Const admtMaintainHierarchy = &H0200
  36. Const bUser = True
  37. Const bGroup = False
  38. Const bComputer = False
  39. Const bSecurity = False
  40. Const bService = False
  41. '----------------------------------------------------------------------------
  42. ' Declarations
  43. '----------------------------------------------------------------------------
  44. Dim objMigration
  45. Dim objUserMigration
  46. Dim objGroupMigration
  47. Dim objComputerMigration
  48. Dim objSecurityTranslation
  49. Dim objServiceAccountEnumeration
  50. '----------------------------------------------------------------------------
  51. ' ADMT Migration Class
  52. '----------------------------------------------------------------------------
  53. Set objMigration = CreateObject("ADMT.Migration")
  54. objMigration.TestMigration = False
  55. objMigration.IntraForest = False
  56. ' Domains
  57. ' "hay-buv.nttest.microsoft.com"
  58. ' "HB-RESWC"
  59. ' Containers
  60. ' "Computers"
  61. ' "Domain Controllers"
  62. ' "HB-ACCT0"
  63. ' "HB-RES"
  64. ' "parent"
  65. ' "Users"
  66. ' "MPO-ACC/Sub"
  67. ' "MPO-RES"
  68. ' "TWENTY_CHAR_OU_00001"
  69. objMigration.SourceDomain = "hay-buv.nttest.microsoft.com"
  70. objMigration.SourceOu = "aou1"
  71. objMigration.TargetDomain = "hay-buv-mpo.nttest.microsoft.com"
  72. objMigration.TargetOu = "TestContainer"
  73. objMigration.RenameOption = admtDoNotRename
  74. 'objMigration.RenamePrefixOrSuffix = "T_"
  75. objMigration.PasswordOption = admtPasswordFromName
  76. 'objMigration.PasswordFile = "C:\Program Files\Active Directory Migration Tool\Logs\Password.txt"
  77. objMigration.ConflictOptions = admtIgnoreConflicting
  78. 'objMigration.ConflictPrefixOrSuffix = ""
  79. '----------------------------------------------------------------------------
  80. ' UserMigration Class
  81. '----------------------------------------------------------------------------
  82. If bUser Then
  83. Set objUserMigration = objMigration.CreateUserMigration
  84. objUserMigration.DisableOption = admtDisableNeither
  85. objUserMigration.SourceExpiration = admtNoExpiration
  86. objUserMigration.MigrateSIDs = False
  87. objUserMigration.TranslateRoamingProfile = False
  88. objUserMigration.UpdateUserRights = False
  89. objUserMigration.MigrateGroups = False
  90. objUserMigration.UpdatePreviouslyMigratedObjects = False
  91. objUserMigration.FixGroupMembership = True
  92. 'objUserMigration.Migrate admtData, Array("Service-Acc-Res","TestUser1","testuser2","bad"), Array("Service*")
  93. 'objUserMigration.Migrate admtDomain, , Array("*Test*User*")
  94. 'objUserMigration.Migrate admtDomain, , Array("*user*")
  95. 'objUserMigration.Migrate admtData, "MPO-ACC/abc"
  96. 'objUserMigration.Migrate admtData, "MPO-ACC/abc"
  97. 'objUserMigration.Migrate admtData, Array("MPO-ACC/W2KTSTCMP")
  98. 'objUserMigration.Migrate admtData, Array("abc","Test Period","test period 1","W2KTSTCMP","Accounting","MPO-ACC/Sub/Sub User")
  99. 'objUserMigration.Migrate admtFile, "E:\Dev\ADMT\Script\UsersA.txt"
  100. 'objUserMigration.Migrate admtDomain + admtRecurse + admtMaintainHierarchy, Array("Test*","IUSR_*","IWAM_*","*Service","What Am I Doing Here")
  101. 'objUserMigration.Migrate admtDomain + admtRecurse, , Array("aUser*")
  102. objUserMigration.Migrate admtFile, "E:\Dev\ADMT\Script\AOu1 Users A.txt"
  103. End If
  104. '----------------------------------------------------------------------------
  105. ' GroupMigration Class
  106. '----------------------------------------------------------------------------
  107. If bGroup Then
  108. Set objGroupMigration = objMigration.CreateGroupMigration
  109. objGroupMigration.MigrateSIDs = False
  110. objGroupMigration.UpdateGroupRights = False
  111. objGroupMigration.UpdatePreviouslyMigratedObjects = False
  112. objGroupMigration.FixGroupMembership = True
  113. objGroupMigration.MigrateMembers = False
  114. objGroupMigration.DisableOption = admtDisableNeither
  115. objGroupMigration.SourceExpiration = admtNoExpiration
  116. objGroupMigration.TranslateRoamingProfile = False
  117. objGroupMigration.Migrate admtDomain + admtRecurse + admtMaintainHierarchy, Array("*$$$")
  118. End If
  119. '----------------------------------------------------------------------------
  120. ' ComputerMigration Class
  121. '----------------------------------------------------------------------------
  122. If bComputer Then
  123. Set objComputerMigration = objMigration.CreateComputerMigration
  124. objComputerMigration.TranslationOption = admtTranslateReplace
  125. objComputerMigration.TranslateFilesAndFolders = False
  126. objComputerMigration.TranslateLocalGroups = False
  127. objComputerMigration.TranslatePrinters = False
  128. objComputerMigration.TranslateRegistry = False
  129. objComputerMigration.TranslateShares = False
  130. objComputerMigration.TranslateUserProfiles = False
  131. objComputerMigration.TranslateUserRights = False
  132. objComputerMigration.RestartDelay = 1
  133. 'objComputerMigration.Migrate admtData, "HB-RES-MEM"
  134. 'objComputerMigration.Migrate admtData, "HB-RESWC-WS1"
  135. 'objComputerMigration.Migrate admtData, Array("HB-RESWC-MEM","HB-RESWC-WS1")
  136. objComputerMigration.Migrate admtDomain + admtRecurse
  137. End If
  138. '----------------------------------------------------------------------------
  139. ' SecurityTranslation Class
  140. '----------------------------------------------------------------------------
  141. If bSecurity Then
  142. Set objSecurityTranslation = objMigration.CreateSecurityTranslation
  143. objSecurityTranslation.TranslationOption = admtTranslateReplace
  144. objSecurityTranslation.FilesAndFolders = False
  145. objSecurityTranslation.LocalGroups = False
  146. objSecurityTranslation.Printers = False
  147. objSecurityTranslation.Registry = False
  148. objSecurityTranslation.Shares = False
  149. objSecurityTranslation.UserProfiles = False
  150. objSecurityTranslation.UserRights = False
  151. objSecurityTranslation.Translate admtDomain
  152. End If
  153. '----------------------------------------------------------------------------
  154. ' ServiceAccountEnumeration Class
  155. '----------------------------------------------------------------------------
  156. If bService Then
  157. Set objServiceAccountEnumeration = objMigration.CreateServiceAccountEnumeration
  158. objServiceAccountEnumeration.Enumerate admtData, Array("MPO-RES/ANOTHERCMP","Sub/ASubComputer","COMPNUM7$","HB-RES-DC1","HB-RES-DC2","HB-RES-MEM","HB-RES-WS1","TESTCMP","TESTCMP1","W2KTSTCMP")
  159. 'objServiceAccountEnumeration.Enumerate admtDomain + admtRecurse
  160. End If